Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 81
Default Hide rows if...

Can anyone help please

I want to hide row10 on sheet 2 if sheet1 A1=Yes,
but every time I make a copy of sheet1 the same requirement is needed to the
new sheet. Always hide the same row (possibly rows) on each sheet

Any takers

Thanks in advance
Saintsman
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default Hide rows if...

Your question is rather ambiguous - I'll assume you mean that row 10 on
any sheet other than Sheet1 needs to be hidden if Sheet1!A1 = Yes...

Put this code in our ThisWorkbook code module:

Private Sub Workbook_SheetActivate(ByVal Sh As Object)
If Sh.Name < "Sheet1" Then
Sh.Rows(10).Hidden = Sheets("Sheet1").Range("A1") = "Yes"
End If
End Sub



In article ,
Saintsman wrote:

Can anyone help please

I want to hide row10 on sheet 2 if sheet1 A1=Yes,
but every time I make a copy of sheet1 the same requirement is needed to the
new sheet. Always hide the same row (possibly rows) on each sheet

Any takers

Thanks in advance
Saintsman

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 81
Default Hide rows if...

Sorry for any ambiguity!
It is not for every sheet except sheet1
The sheet will be 1 of many similar calculation sheets, each of which needs
the function to hide specific rows if sheet1 A1 = Yes (same rows in each case)
There are other sheets which should not have the function.
My plan was to have a sort of template sheet with the function on, which is
then available every time a copy of that sheet is made


"JE McGimpsey" wrote:

Your question is rather ambiguous - I'll assume you mean that row 10 on
any sheet other than Sheet1 needs to be hidden if Sheet1!A1 = Yes...

Put this code in our ThisWorkbook code module:

Private Sub Workbook_SheetActivate(ByVal Sh As Object)
If Sh.Name < "Sheet1" Then
Sh.Rows(10).Hidden = Sheets("Sheet1").Range("A1") = "Yes"
End If
End Sub



In article ,
Saintsman wrote:

Can anyone help please

I want to hide row10 on sheet 2 if sheet1 A1=Yes,
but every time I make a copy of sheet1 the same requirement is needed to the
new sheet. Always hide the same row (possibly rows) on each sheet

Any takers

Thanks in advance
Saintsman


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
Group rows (or hide rows) like in MS Project Annie1904 Excel Worksheet Functions 2 October 17th 09 05:15 AM
Macro code to hide rows and not calculate hidden rows bradmcq Excel Discussion (Misc queries) 0 September 1st 09 12:38 AM
Enabling option „Format rows“ to hide/unhide rows using VBA-code? ran58 Excel Discussion (Misc queries) 0 July 28th 09 03:46 PM
Specify which rows to NOT hide, and have excel hide the rest Mo2 Excel Programming 0 April 25th 07 03:44 AM
Hide Rows - copy and paste only rows that show Access101 Excel Worksheet Functions 3 March 1st 06 12:39 AM


All times are GMT +1. The time now is 09:25 PM.

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"