Home |
Search |
Today's Posts |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I tired all the suggestions and still cant get it to work.
I tried the below but cant figure out the right way to use the variable of Wk with out error. I know its probably me being obtuse but can someone give me an example based on this (the excel help stinks) ActiveWorkbook.Worksheets("EventQuery-2007-03-29-14-59-24(").Sort.SortFields. _ Add Key:=Range("B1"), SortOn:=xlSortOnValues, Order:=xlAscending, _ DataOption:=xlSortNormal THANKS "Halim" wrote: It means you can not use special name of : Cell, Sheet, Workbook but you have to set a variable for them in order to use them unabsolute, just like: Set Wk = ActiveSheet or Set Wk = Sheets("sheetname") etc... -- Regards, Halim "Gord Dibben" wrote: ActiveWorkbook ActiveSheet ActiveCell Make the required edits to get rid of hard-coded references. Gord Dibben MS Excel MVP On Thu, 29 Mar 2007 12:24:02 -0700, Michael wrote: 2007 Excel, I am trying to create macros by recording my actions but when I do they dont work cause the name of the worksheet is different. Tried the relative reference but doesnt help. Tried deleting the reference out of macro but doesnt work. Just want generic macro that will work on any file name and any worksheet name. Ex. even to sort when you select the page in upper left. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do you get a macro to reference the worksheet it is being run | Excel Discussion (Misc queries) | |||
Newbie Cell Reference Question... | New Users to Excel | |||
Newbie vba - How do I reference cells in another workbook | Excel Programming | |||
Newbie help with cell reference | Excel Programming | |||
Newbie question on cell reference 2 | Excel Programming |