Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
I have the macro as follows: Sub hide() ' ' hide Macro ' Macro recorded 2004/05/02 by ' ' Keyboard Shortcut: Ctrl+h ' Columns("M:O").Select Selection.EntireColumn.Hidden = True Columns("X:Z").Select Selection.EntireColumn.Hidden = True Columns("AI:AK").Select Selection.EntireColumn.Hidden = True Columns("AT:AV").Select Selection.EntireColumn.Hidden = True Columns("BE:BG").Select Selection.EntireColumn.Hidden = True Columns("BP:BR").Select Selection.EntireColumn.Hidden = True Columns("CA:CC").Select Selection.EntireColumn.Hidden = True Columns("CF:CF").Select Selection.EntireColumn.Hidden = True Columns("CM:CM").Select Selection.EntireColumn.Hidden = True Columns("CR:CR").Select Selection.EntireColumn.Hidden = True End Sub Everytime I play the macro, it hides everything, need help to sort i out, as I want it to unhide and hide these columns for view an printing purposes, well, to fit on page. I am including a zip file for anyone to see. my email address is: Thank Attachment filename: mastertimesheet6d.zip Download attachment: http://www.excelforum.com/attachment.php?postid=53153 -- Message posted from http://www.ExcelForum.com |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
It's better to stay in the original thead so that anyone who wants to help will
know what's been tried. I tried J.E.'s code and it worked for me. You may have introduced some extra characters or chopped something when you copied from the news post. "sonar <" wrote: Hi I have the macro as follows: Sub hide() ' ' hide Macro ' Macro recorded 2004/05/02 by ' ' Keyboard Shortcut: Ctrl+h ' Columns("M:O").Select Selection.EntireColumn.Hidden = True Columns("X:Z").Select Selection.EntireColumn.Hidden = True Columns("AI:AK").Select Selection.EntireColumn.Hidden = True Columns("AT:AV").Select Selection.EntireColumn.Hidden = True Columns("BE:BG").Select Selection.EntireColumn.Hidden = True Columns("BP:BR").Select Selection.EntireColumn.Hidden = True Columns("CA:CC").Select Selection.EntireColumn.Hidden = True Columns("CF:CF").Select Selection.EntireColumn.Hidden = True Columns("CM:CM").Select Selection.EntireColumn.Hidden = True Columns("CR:CR").Select Selection.EntireColumn.Hidden = True End Sub Everytime I play the macro, it hides everything, need help to sort it out, as I want it to unhide and hide these columns for view and printing purposes, well, to fit on page. I am including a zip file for anyone to see. my email address is: Thanks Attachment filename: mastertimesheet6d.zip Download attachment: http://www.excelforum.com/attachment.php?postid=531534 --- Message posted from http://www.ExcelForum.com/ -- Dave Peterson |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi, I am using Excell 2000, would that work on that version
-- Message posted from http://www.ExcelForum.com |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
It should work in all versions with VBA (xl5 and later).
-- Regards, Tom Ogilvy "sonar " wrote in message ... Hi, I am using Excell 2000, would that work on that version? --- Message posted from http://www.ExcelForum.com/ |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Perhaps try copying this alteration of JE's code:
Public Sub Hide() Range("M:O,X:Z,AI:AK,AT:AV," & _ "BE:BG,BP:BR,CA:CC," & _ "CF:CF,CM:CM,CR:CR") _ .EntireColumn.Hidden = True End Sub Paste that in a general module, not a module associated with the worksheet, then try running it. It worked fine for me. -- Regards, tom Ogilvy "Tom Ogilvy" wrote in message ... It should work in all versions with VBA (xl5 and later). -- Regards, Tom Ogilvy "sonar " wrote in message ... Hi, I am using Excell 2000, would that work on that version? --- Message posted from http://www.ExcelForum.com/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel closes down during a macro | Excel Discussion (Misc queries) | |||
Macro Editor closes Excel 2000 ? | Excel Discussion (Misc queries) | |||
macro that closes excel application and open another app | Excel Programming | |||
Macro closes excel and therefore won't run anymore | Excel Programming | |||
Making a macro run when the user closes a workbook | Excel Programming |