The macro below was written to be able to refresh selected data on one
sheet of a workbook . I placed a button on the sheet that was linked
to this macro. When the button was pushed the data was refreshed as I
as I had hoped. However, on clicking any cell on the sheet the macro
would run. I then removed the button and found that the macro would
still run when selecting any cell. So then I deleted the macro and
now when I click any cell I get the message that the refresh macro
could not be found. Of course it couldn’t be found because I deleted
it, by why does it even try to look for it?  Any suggestions?

Tommy

Sub Refresh()
    Sheets("Input_T1").Select
    Range("CO$458:GX$458").Select
    Selection.Copy
    Sheets("Reports_T1").Select
    Range("M16").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
        :=False, Transpose:=True
    'Sort sales data in reports page
    Sheets("Reports_T1").Select
    Range("M16:N125").Select
    Selection.Copy
    Range("B3").Select
    ActiveSheet.Paste
    Application.CutCopyMode = False
    ActiveSheet.Unprotect
    Selection.Sort Key1:=Range("B110"), Order1:=xlDescending,
Header:=xlGuess _
        , OrderCustom:=1, MatchCase:=False,
Orientation:=xlTopToBottom, _
        DataOption1:=xlSortNormal
    Range("B1").Select
    ActiveSheet.Protect
End Sub

--~--~---------~--~----~------------~-------~--~----~
----------------------------------------------------------------------------------
Some important links for excel users:
1. Excel and VBA Tutorials(Video and Text), Free add-ins downloads at 
http://www.excelitems.com
2. Excel tutorials at http://www.excel-macros.blogspot.com
3. Learn VBA Macros at http://www.vbamacros.blogspot.com
4. Excel Tips and Tricks at http://exceldailytip.blogspot.com
 

To post to this group, send email to excel-macros@googlegroups.com
If you find any spam message in the group, please send an email to:
Ayush Jain  @ jainayus...@gmail.com or
Ashish Jain @ 26may.1...@gmail.com
<><><><><><><><><><><><><><><><><><><><><><>
HELP US GROW !!

We reach over 6,500 subscribers worldwide and receive many nice notes about the 
learning and support from the group. Our goal is to have 10,000 subscribers by 
the end of 2009. Let friends and co-workers know they can subscribe to group at 
http://groups.google.com/group/excel-macros/subscribe
-~----------~----~----~----~------~----~------~--~---

Reply via email to