Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3
Default 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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,722
Default 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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to name worksheet tabs using a cell within the worksheet? Jennifer Excel Discussion (Misc queries) 4 November 6th 12 05:03 PM
Macro Copy Worksheet Name into worksheet A1 bmac Excel Worksheet Functions 3 October 4th 07 07:51 PM
Macro to Create New Worksheet and Reference Cell in Old Worksheet As Tab Name - "Object Required" Error [email protected] Excel Discussion (Misc queries) 4 September 25th 06 01:35 PM
I want in one worksheet to relatively link to/reference cells in another without changing the format of the current worksheet. [email protected] Excel Discussion (Misc queries) 0 September 22nd 05 04:39 PM
transfer one worksheet to another worksheet without losing format. TwiztidKitten Excel Worksheet Functions 1 August 18th 05 09:49 PM


All times are GMT +1. The time now is 04:20 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"