Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I need to hide several rows on sheet - ie if sheet1 A1 = YES hide rows 45-50
on sheet2 (I can mange that!), but... Every time I make a copy of sheet2 I want the same functionality to apply -always hiding/unhiding the same rows without having to amend any coding. Is it possible? Thanks in advance Saintsman |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
If you make the reference to ActiveSheet rather than Sheets("Sheet1") in your code, then it should work OK. -- Regards Roger Govier "Saintsman" wrote in message ... I need to hide several rows on sheet - ie if sheet1 A1 = YES hide rows 45-50 on sheet2 (I can mange that!), but... Every time I make a copy of sheet2 I want the same functionality to apply -always hiding/unhiding the same rows without having to amend any coding. Is it possible? Thanks in advance Saintsman |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sorry Roger - not understanding what you mean here I'm afraid
The workbook will have several sheets where I do not want to hide any rows, how do I differentate btween those that do & don't when I haven't created the sheets yet "Roger Govier" wrote: Hi If you make the reference to ActiveSheet rather than Sheets("Sheet1") in your code, then it should work OK. -- Regards Roger Govier "Saintsman" wrote in message ... I need to hide several rows on sheet - ie if sheet1 A1 = YES hide rows 45-50 on sheet2 (I can mange that!), but... Every time I make a copy of sheet2 I want the same functionality to apply -always hiding/unhiding the same rows without having to amend any coding. Is it possible? Thanks in advance Saintsman |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Saintsman-
So your worksheet has the condition of A1='Yes' then hide some rows. When you say so will have sheet with the rows hidden and some won't, would you be running this macro just to set up the worksheet? "Saintsman" wrote: Sorry Roger - not understanding what you mean here I'm afraid The workbook will have several sheets where I do not want to hide any rows, how do I differentate btween those that do & don't when I haven't created the sheets yet "Roger Govier" wrote: Hi If you make the reference to ActiveSheet rather than Sheets("Sheet1") in your code, then it should work OK. -- Regards Roger Govier "Saintsman" wrote in message ... I need to hide several rows on sheet - ie if sheet1 A1 = YES hide rows 45-50 on sheet2 (I can mange that!), but... Every time I make a copy of sheet2 I want the same functionality to apply -always hiding/unhiding the same rows without having to amend any coding. Is it possible? Thanks in advance Saintsman |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Not just to set up worksheet
I will end up with perhaps 10 sheets where I want the option to Hide several rows (always the same rows), but the remaining sheets should not be affected My problem is that I can't create the sheets on day 1, new sheets will be added over a period of time & I do not want to keep revisiting the workbook "JRForm" wrote: Saintsman- So your worksheet has the condition of A1='Yes' then hide some rows. When you say so will have sheet with the rows hidden and some won't, would you be running this macro just to set up the worksheet? "Saintsman" wrote: Sorry Roger - not understanding what you mean here I'm afraid The workbook will have several sheets where I do not want to hide any rows, how do I differentate btween those that do & don't when I haven't created the sheets yet "Roger Govier" wrote: Hi If you make the reference to ActiveSheet rather than Sheets("Sheet1") in your code, then it should work OK. -- Regards Roger Govier "Saintsman" wrote in message ... I need to hide several rows on sheet - ie if sheet1 A1 = YES hide rows 45-50 on sheet2 (I can mange that!), but... Every time I make a copy of sheet2 I want the same functionality to apply -always hiding/unhiding the same rows without having to amend any coding. Is it possible? Thanks in advance Saintsman |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
Since you say that hiding rows will be conditional upon a value in a certain cell (Sheet1!A1), could you not AND that with the presence of a value in a given cell on the individual sheets. That way, would could easily alter which sheets have the rows hidden or not. -- Regards Roger Govier "Saintsman" wrote in message ... Not just to set up worksheet I will end up with perhaps 10 sheets where I want the option to Hide several rows (always the same rows), but the remaining sheets should not be affected My problem is that I can't create the sheets on day 1, new sheets will be added over a period of time & I do not want to keep revisiting the workbook "JRForm" wrote: Saintsman- So your worksheet has the condition of A1='Yes' then hide some rows. When you say so will have sheet with the rows hidden and some won't, would you be running this macro just to set up the worksheet? "Saintsman" wrote: Sorry Roger - not understanding what you mean here I'm afraid The workbook will have several sheets where I do not want to hide any rows, how do I differentate btween those that do & don't when I haven't created the sheets yet "Roger Govier" wrote: Hi If you make the reference to ActiveSheet rather than Sheets("Sheet1") in your code, then it should work OK. -- Regards Roger Govier "Saintsman" wrote in message ... I need to hide several rows on sheet - ie if sheet1 A1 = YES hide rows 45-50 on sheet2 (I can mange that!), but... Every time I make a copy of sheet2 I want the same functionality to apply -always hiding/unhiding the same rows without having to amend any coding. Is it possible? Thanks in advance Saintsman |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Saintsman-
Try this by placing this code below in the "Thisworkbook" code section. when inserting a new sheet you will be asked if you want to hide rows 45-50. Private Sub Workbook_NewSheet(ByVal Sh As Object) Call SaintsMan End Sub Sub SaintsMan() Dim Msg, Style, Title, Response Msg = "Do you want to hide rows ?" Style = vbYesNo + vbCritical + vbDefaultButton2 Title = "Hide Some" Response = MsgBox(Msg, Style, Title) If Response = vbYes Then ActiveSheet.Rows("45:50").Select Selection.EntireRow.Hidden = True Else Exit Sub End If End Sub "Saintsman" wrote: Not just to set up worksheet I will end up with perhaps 10 sheets where I want the option to Hide several rows (always the same rows), but the remaining sheets should not be affected My problem is that I can't create the sheets on day 1, new sheets will be added over a period of time & I do not want to keep revisiting the workbook "JRForm" wrote: Saintsman- So your worksheet has the condition of A1='Yes' then hide some rows. When you say so will have sheet with the rows hidden and some won't, would you be running this macro just to set up the worksheet? "Saintsman" wrote: Sorry Roger - not understanding what you mean here I'm afraid The workbook will have several sheets where I do not want to hide any rows, how do I differentate btween those that do & don't when I haven't created the sheets yet "Roger Govier" wrote: Hi If you make the reference to ActiveSheet rather than Sheets("Sheet1") in your code, then it should work OK. -- Regards Roger Govier "Saintsman" wrote in message ... I need to hide several rows on sheet - ie if sheet1 A1 = YES hide rows 45-50 on sheet2 (I can mange that!), but... Every time I make a copy of sheet2 I want the same functionality to apply -always hiding/unhiding the same rows without having to amend any coding. Is it possible? Thanks in advance Saintsman |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Color alternate rows when after hiding selected rows | Excel Worksheet Functions | |||
Hiding Specific Rows Based on Values in Other Rows | Excel Worksheet Functions | |||
Hiding a button when hiding rows | Excel Discussion (Misc queries) | |||
hiding Rows and buttons/comboxes, over the rows | Excel Programming | |||
Hiding Rows if the linked rows are blank | Excel Discussion (Misc queries) |