Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Junior Member
 
Posts: 13
Default hide rows in workbook

hi,

i have a workbook with four scenarios and one input sheet.

in input sheet - there is cell to get the value of retirement age.

is it possible; that when i enter a certain age lets say 55, then in all the other four scenario sheets should hide rows 15:20.

macro should pick the value from retiremnt age cell lets say b4, everytime it runs.

so in simple words, when i enter retirement age in cell b4 of input sheet, the following worksheets should hide the rows 15:20.

thanks in advance
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,872
Default hide rows in workbook

Hi Umesh,

Am Mon, 7 May 2012 12:23:18 +0000 schrieb Umesh Banga:

is it possible; that when i enter a certain age lets say 55, then in all
the other four scenario sheets should hide rows 15:20.


try in code module of input sheet:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim i As Integer

If Target.Address < "$B$4" Or Target.Count 1 _
Then Exit Sub

For i = 2 To Sheets.Count
Sheets(i).Rows("15:20").Hidden = Target = 55
Next
End Sub


Regards
Claus Busch
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2
  #3   Report Post  
Junior Member
 
Posts: 13
Default

awesome t works, however, how can i enter if the value is 55, then gide row 15-20, if value is 60 then hide row 20-25, and if value is 65 then do not hide any row.

Quote:
Originally Posted by Claus Busch View Post
Hi Umesh,

Am Mon, 7 May 2012 12:23:18 +0000 schrieb Umesh Banga:

is it possible; that when i enter a certain age lets say 55, then in all
the other four scenario sheets should hide rows 15:20.


try in code module of input sheet:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim i As Integer

If Target.Address < "$B$4" Or Target.Count 1 _
Then Exit Sub

For i = 2 To Sheets.Count
Sheets(i).Rows("15:20").Hidden = Target = 55
Next
End Sub


Regards
Claus Busch
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2
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
Enabling option „Format rows“ to hide/unhide rows using VBA-code? ran58 Excel Discussion (Misc queries) 0 July 28th 09 03:46 PM
Code for Excel 2007 to hide rows based on sum of several rows not ina range Joe Gardill Excel Programming 2 August 29th 08 03:53 PM
How to hide rows in a Workbook with multiple sheets with zero valu khurram_razaq Excel Programming 6 June 6th 08 02:18 PM
Hide rows with zero's on several sheets within a workbook khurram_razaq Excel Programming 11 June 6th 08 01:02 PM
Specify which rows to NOT hide, and have excel hide the rest Mo2 Excel Programming 0 April 25th 07 03:44 AM


All times are GMT +1. The time now is 08:33 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"