Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
new macro to format worksheet
I'm trying to record a new macro to hide specific columns & rows. I went to
"record new macro" and went through the steps, but when I try to test out the macro I recorded, it ends up hiding more columns than I wanted. For instance, I want to hide H:I, K:M, S:AE & AG:AH, but when I play the macro it ends up hiding F:BC. How do I fix that? |
#2
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
new macro to format worksheet
It may depend on how you recorded it, what order you selected things, etc.
Correction: Open the VBA (Alt+F11), open the module you're macro is reocrded in. whatever part is there dealing with hiding the columns can be deleted and replaced with this single line: Range("H:I,K:M,S:AE,AG:AH").EntireColumn.Hidden = True Of note, rows can be done with something like Range("5:6,10:11")EntireRow.Hidden = True -- Best Regards, Luke M *Remember to click "yes" if this post helped you!* "mclovin" wrote: I'm trying to record a new macro to hide specific columns & rows. I went to "record new macro" and went through the steps, but when I try to test out the macro I recorded, it ends up hiding more columns than I wanted. For instance, I want to hide H:I, K:M, S:AE & AG:AH, but when I play the macro it ends up hiding F:BC. How do I fix that? |
#3
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
new macro to format worksheet
It didn't work. Perhaps I deleted too much??
So in my module, it says: Range("H:I,K:M,S:AE,AG:AH").EntireColumn.Hidden = True End Sub "Luke M" wrote: It may depend on how you recorded it, what order you selected things, etc. Correction: Open the VBA (Alt+F11), open the module you're macro is reocrded in. whatever part is there dealing with hiding the columns can be deleted and replaced with this single line: Range("H:I,K:M,S:AE,AG:AH").EntireColumn.Hidden = True Of note, rows can be done with something like Range("5:6,10:11")EntireRow.Hidden = True -- Best Regards, Luke M *Remember to click "yes" if this post helped you!* "mclovin" wrote: I'm trying to record a new macro to hide specific columns & rows. I went to "record new macro" and went through the steps, but when I try to test out the macro I recorded, it ends up hiding more columns than I wanted. For instance, I want to hide H:I, K:M, S:AE & AG:AH, but when I play the macro it ends up hiding F:BC. How do I fix that? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro to name worksheet tabs using a cell within the worksheet? | Excel Discussion (Misc queries) | |||
Macro Copy Worksheet Name into worksheet A1 | Excel Worksheet Functions | |||
Macro to Create New Worksheet and Reference Cell in Old Worksheet As Tab Name - "Object Required" Error | Excel Discussion (Misc queries) | |||
I want in one worksheet to relatively link to/reference cells in another without changing the format of the current worksheet. | Excel Discussion (Misc queries) | |||
transfer one worksheet to another worksheet without losing format. | Excel Worksheet Functions |