LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Conditional Hiding of Rows

Hello,

I am new with VB macro, so far I have created an option button with
the objective to hide tons of rows but when i started entering the row
numbers it became painful, i even thot of named ranges but that would
be an issue if i added or deleted a single row from my worksheet!! so
far my code goes like this:

Dim nAmHide As Boolean

Private Sub nAmhide1_Click()
nAmHide = False
End Sub

Private Sub nAmhide2_Click()
nAmHide = True
End Sub

For Each sht In Sheets

If nAmHide = True And sht.Name = "Assumptions" Then
sht.Rows("4:5").EntireRow.Hidden = True
sht.Rows("15:16").EntireRow.Hidden = True
sht.Rows("24:25").EntireRow.Hidden = True
sht.Rows("33:34").EntireRow.Hidden = True
sht.Rows("43:44").EntireRow.Hidden = True
End If

in the above code rows 4:5 represents country France for example,
15:16 is germany, 24,:25 is Spain, 33:34 is Italy and so on the
country names comes in repititions uptil rows 1300. I thot of namesd
ranges but that will be a pain!

Is there a way to conditonally say if its France then hide those rows
in that sheet, or if its UK , then hide those rows specifically and
so on and so forth??

Thanks much!
SV

 
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
Color alternate rows when after hiding selected rows Monk[_2_] Excel Worksheet Functions 6 June 7th 08 01:36 AM
Hiding Specific Rows Based on Values in Other Rows Chris Excel Worksheet Functions 1 November 2nd 06 08:21 PM
Hiding a button when hiding rows fergusor Excel Discussion (Misc queries) 2 August 10th 06 02:31 PM
Conditional hiding of entire rows Nick Turner Excel Worksheet Functions 4 January 2nd 06 11:09 PM
Hiding Rows if the linked rows are blank KG Excel Discussion (Misc queries) 9 May 18th 05 02:32 AM


All times are GMT +1. The time now is 01:20 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"