Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Sorting Columns Independently Followup From 3/13
I need to add a line to the macro, so that it only works on a sheet named
"sort". This is so if the short cut to run the macro is run by accident (when another sheet tab is the current worksheet) it only affects the data on the "sort" worksheet. How do you identify which sheet of a workbook a macro is assigned to run in...and that sheet only, even if you are working in another worksheet (same workbook though)? |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Sorting Columns Independently Followup From 3/13
Insert this line as 1st line of your macro:
Worksheets("sort").Select Regards, Stefi €˛curtc.€¯ ezt Ć*rta: I need to add a line to the macro, so that it only works on a sheet named "sort". This is so if the short cut to run the macro is run by accident (when another sheet tab is the current worksheet) it only affects the data on the "sort" worksheet. How do you identify which sheet of a workbook a macro is assigned to run in...and that sheet only, even if you are working in another worksheet (same workbook though)? |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Sorting Columns Independently Followup From 3/13
I think it would be better to qualify your ranges.
Instead of range("A1:B99").sort key1:=range("a1"), ... use with worksheets("Sort") .range("a1:B99").sort key1:=.range("A1"), .... end with The dots in front of those .Range()'s means that they belong to the object in the previous with. In this case, that's the Sort worksheet. If you have trouble adjusting your code, post what you have and I'm sure you'll get help. curtc. wrote: I need to add a line to the macro, so that it only works on a sheet named "sort". This is so if the short cut to run the macro is run by accident (when another sheet tab is the current worksheet) it only affects the data on the "sort" worksheet. How do you identify which sheet of a workbook a macro is assigned to run in...and that sheet only, even if you are working in another worksheet (same workbook though)? -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
sorting columns at the same time but independently of each other | Excel Discussion (Misc queries) | |||
Group adjacent columns independently | Excel Discussion (Misc queries) | |||
Filtering columns independently | Excel Discussion (Misc queries) | |||
Sorting data rows independently | Excel Discussion (Misc queries) | |||
countif followup | Excel Worksheet Functions |