Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
A macro I have written hides rows in one sheet. However, it also is hiding
the same rows in a different sheet. How do I get a macro to run in only one sheet? -- Marc |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Post your code, someone will help..........
Vaya con Dios, Chuck, CABGx3 "Marcus Analyst" wrote: A macro I have written hides rows in one sheet. However, it also is hiding the same rows in a different sheet. How do I get a macro to run in only one sheet? -- Marc |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Here is the code:
Sub Auto_Open() ' ' Auto_Open Macro ' Hides rows 10-28 (Steps 2 and 3) ' ' Keyboard Shortcut: Ctrl+x ' Rows("10:26").Select Selection.EntireRow.Hidden = True End Sub -- Marc "CLR" wrote: Post your code, someone will help.......... Vaya con Dios, Chuck, CABGx3 "Marcus Analyst" wrote: A macro I have written hides rows in one sheet. However, it also is hiding the same rows in a different sheet. How do I get a macro to run in only one sheet? -- Marc |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Gary's Student just showed you.............insert this line above your "Hide
rows" line substituting your sheet name for "Sheet2" Sheets("Sheet2").Activate Vaya con Dios, Chuck, CABGx3 "Marcus Analyst" wrote: Here is the code: Sub Auto_Open() ' ' Auto_Open Macro ' Hides rows 10-28 (Steps 2 and 3) ' ' Keyboard Shortcut: Ctrl+x ' Rows("10:26").Select Selection.EntireRow.Hidden = True End Sub -- Marc "CLR" wrote: Post your code, someone will help.......... Vaya con Dios, Chuck, CABGx3 "Marcus Analyst" wrote: A macro I have written hides rows in one sheet. However, it also is hiding the same rows in a different sheet. How do I get a macro to run in only one sheet? -- Marc |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
CLR, tried it both of these ways - name of the sheet is "current". Still
hiding rows in another sheet - is it that my macros are all in one module? And if so, how do I put my macros into their own separate modules? METHOD ONE: Sub Auto_Open() ' ' Auto_Open Macro ' Hides rows 10-28 (Steps 2 and 3) ' ' Keyboard Shortcut: Ctrl+x ' Sheets("Current").Activate Rows("10:26").Select Selection.EntireRow.Hidden = True End Sub METHOD TWO: Sub Auto_Open() ' ' Auto_Open Macro ' Sheets("Current").Activate ' Hides rows 10-28 (Steps 2 and 3) ' ' Keyboard Shortcut: Ctrl+x ' Rows("10:26").Select Selection.EntireRow.Hidden = True End Sub -- Marc "CLR" wrote: Gary's Student just showed you.............insert this line above your "Hide rows" line substituting your sheet name for "Sheet2" Sheets("Sheet2").Activate Vaya con Dios, Chuck, CABGx3 "Marcus Analyst" wrote: Here is the code: Sub Auto_Open() ' ' Auto_Open Macro ' Hides rows 10-28 (Steps 2 and 3) ' ' Keyboard Shortcut: Ctrl+x ' Rows("10:26").Select Selection.EntireRow.Hidden = True End Sub -- Marc "CLR" wrote: Post your code, someone will help.......... Vaya con Dios, Chuck, CABGx3 "Marcus Analyst" wrote: A macro I have written hides rows in one sheet. However, it also is hiding the same rows in a different sheet. How do I get a macro to run in only one sheet? -- Marc |
#6
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
CLR, thanks for your help - but i went ahead and recorded the macro using the
following procedu I had the file open on the sheet not to have rows hidden - we'll call it "sheet nothide". Then I recorded the macro, first by selecting the sheet where I wanted to have the rows hidden "sheet hide" - then selected the rows to hide, then hid them then stopped recording. Worked like a charm! -- Marc "CLR" wrote: Gary's Student just showed you.............insert this line above your "Hide rows" line substituting your sheet name for "Sheet2" Sheets("Sheet2").Activate Vaya con Dios, Chuck, CABGx3 "Marcus Analyst" wrote: Here is the code: Sub Auto_Open() ' ' Auto_Open Macro ' Hides rows 10-28 (Steps 2 and 3) ' ' Keyboard Shortcut: Ctrl+x ' Rows("10:26").Select Selection.EntireRow.Hidden = True End Sub -- Marc "CLR" wrote: Post your code, someone will help.......... Vaya con Dios, Chuck, CABGx3 "Marcus Analyst" wrote: A macro I have written hides rows in one sheet. However, it also is hiding the same rows in a different sheet. How do I get a macro to run in only one sheet? -- Marc |
#7
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Perhaps something like:
Sub hide_um() Sheets("Sheet2").Activate Cells(13, 1).EntireRow.Hidden = True End Sub -- Gary''s Student - gsnu200763 "Marcus Analyst" wrote: A macro I have written hides rows in one sheet. However, it also is hiding the same rows in a different sheet. How do I get a macro to run in only one sheet? -- Marc |
#8
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Gary's Student, thanks for your help - but i went ahead and recorded the
macro using the following procedu I had the file open on the sheet not to have rows hidden - we'll call it "sheet nothide". Then I recorded the macro, first by selecting the sheet where I wanted to have the rows hidden "sheet hide" - then selected the rows to hide, then hid them then stopped recording. Worked like a charm! -- Marc "Gary''s Student" wrote: Perhaps something like: Sub hide_um() Sheets("Sheet2").Activate Cells(13, 1).EntireRow.Hidden = True End Sub -- Gary''s Student - gsnu200763 "Marcus Analyst" wrote: A macro I have written hides rows in one sheet. However, it also is hiding the same rows in a different sheet. How do I get a macro to run in only one sheet? -- Marc |
#9
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Another perhaps. At the start of the code:
If ActiveSheet.Name < "Sheet2" Then Exit Sub or you could have something like: If ActiveSheet.Name < "Sheet2" Then MsgBox "This Macro only works in Sheet2", , "Marcus Software" Exit Sub End If -- HTH Sandy In Perth, the ancient capital of Scotland and the crowning place of kings Replace @mailinator.com with @tiscali.co.uk "Marcus Analyst" wrote in message ... A macro I have written hides rows in one sheet. However, it also is hiding the same rows in a different sheet. How do I get a macro to run in only one sheet? -- Marc |
#10
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Sandy, thanks for your help - but i went ahead and recorded the macro using
the following procedu I had the file open on the sheet not to have rows hidden - we'll call it "sheet nothide". Then I recorded the macro, first by selecting the sheet where I wanted to have the rows hidden "sheet hide" - then selected the rows to hide, then hid them then stopped recording. Worked like a charm! -- Marc "Sandy Mann" wrote: Another perhaps. At the start of the code: If ActiveSheet.Name < "Sheet2" Then Exit Sub or you could have something like: If ActiveSheet.Name < "Sheet2" Then MsgBox "This Macro only works in Sheet2", , "Marcus Software" Exit Sub End If -- HTH Sandy In Perth, the ancient capital of Scotland and the crowning place of kings Replace @mailinator.com with @tiscali.co.uk "Marcus Analyst" wrote in message ... A macro I have written hides rows in one sheet. However, it also is hiding the same rows in a different sheet. How do I get a macro to run in only one sheet? -- Marc |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
how do I apply changes I make on one sheet to other sheets? | Excel Discussion (Misc queries) | |||
apply a macro to all sheets except for a certain sheet | Excel Discussion (Misc queries) | |||
Apply Validation on a protected sheet | Excel Discussion (Misc queries) | |||
Not apply macro to every worksheet in activeworkbook | Setting up and Configuration of Excel | |||
How to apply a macro to a protected cell | Excel Discussion (Misc queries) |