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: 215
Default Hide Unapplicable Ranges of Entire Rows

Depending on the integer value displayed in cell L10, I'm trying to hide
unapplicable predefined sets of entire rows, just to make the computations
easier to follow.

For example, if cell L10 displays a value of 3 (::myValue), then hide the
entire rows corresponding to myValue of 1, 2, 4, 5, 6, 7, 8, 9
If cell L10 displays a value of 7 (::myValue), then hide the entire rows
corresponding to myValue of 1, 2, 3, 4, 5, 6, 8, 9. And so on.

Here is the simple macro that does not work:

Option Base
-------------------------------------------------------------------------------------------
Sub HideOtherScens (mySheet1, mySheet2, myValue)
' mySheet1 & mySheet2 are string arguments
' myValue is integer value in cell L10
'
Dim myName (1 To 9) As String
Dim i As Integer
'
myName (1) = mySheet1.Rows ("12:21") ' corresponds to myValue = 1
myName (2) = mySheet1.Rows ("22:31") ' corresponds to myValue = 2
.............................
myName (9) = mySheet2.Rows ("74:85") ' corresponds to myValue = 9

For i = 1 To 9
If myValue = i Then
myName (i).EntireRow.Hidden = False
Else
myName (i).EntireRow.Hidden = True
End If
Next i
End Su
-------------------------------------------------------------------------------------------

"Compile error: Invalid qualifier", and following the If statement myName is
highlighted.

Where did I go wrong ? Perhaps in the string array declaration ??

Your suggestions would be greatly appreciated.


 
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
CF for specific ranges of time for an entire column C.Poppell Excel Discussion (Misc queries) 9 December 4th 08 06:46 AM
Hide a CELL (not entire row or column) when printing shapiro Excel Discussion (Misc queries) 4 July 2nd 07 01:50 PM
Hide an entire tab. ChuckF Excel Worksheet Functions 3 March 28th 06 05:52 PM
Copy entire ranges RJF Excel Worksheet Functions 2 February 17th 06 03:58 PM
Hide/Delete entire rows based in the content of one cell Clueless Excel Discussion (Misc queries) 2 October 3rd 05 02:40 PM


All times are GMT +1. The time now is 10:07 AM.

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"