View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Dana DeLouis Dana DeLouis is offline
external usenet poster
 
Posts: 947
Default Using variables in Rows.Select

Just another option if you don't like working w/ strings.

Sub Demo()
Dim TopRow As Long
Dim BottomRow As Long

TopRow = 8
BottomRow = 12

Rows(TopRow).Resize(BottomRow - TopRow + 1).Hidden = True
End Sub

--
HTH :)
Dana DeLouis


"Karen53" wrote in message
...
Hi,

I have a procedure where I determine the range of rows I want to hide.
I
have tested the values and things are working up to the Rows statement.
How
do I use variables in the statement below? I have tried several
combinations and nothing works. Can anyone tell me what I'm missing?

Both variables are Dim as Long

Rows(LastRow&":"& BottomRow).Select
This gives me a compile error, expected list separator or )

Selection.EntireRow.Hidden = True

Thanks