Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 92
Default Using a variable in a Rows Hidden Staement

I want to hide a number of row in my work book and with help from a previous
post I can do this for a fixed number of rows

Rows ("5:7").Hidden = True

My new problem is in this instance the last row I want to hide is fixed bu
the first roe number is defined by the variable - hideStart in the code below

Private Sub Set_LanButton_Click()
Dim numStart&, numStop&, numCells&, lanStart&, hideStart

lanStart = Val(txtbxLanNumber.Value)
numStart = Val(txtbxOSNumber.Value)
numStop = Val(txtbxNumberOS.Value)
numCells = 7 + numStop
hideStart = numCells + 1

Range("C8").Value = numStart
Range("C9:C" & numCells).Formula = "=R[-1]C3+1"
Range("B8:B" & numCells) = Val(txtbxLanNumber.Value)
Application.CutCopyMode = False
'--- I need a statement here to hide rows
'the starting row reference being the variable hideStart
'and the last row is 33

Me.MultiPage1.Value = 4

End Sub

My attempt

Rows(hideStart:"33").Hiiden = True

returns a syntax error

Can anyone point me in the right direction please.

Thanks in advance

Mark
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default Using a variable in a Rows Hidden Staement

Try

Rows(hideStart & ":33").Hidden = True

"Mark Dullingham" wrote:

I want to hide a number of row in my work book and with help from a previous
post I can do this for a fixed number of rows

Rows ("5:7").Hidden = True

My new problem is in this instance the last row I want to hide is fixed bu
the first roe number is defined by the variable - hideStart in the code below

Private Sub Set_LanButton_Click()
Dim numStart&, numStop&, numCells&, lanStart&, hideStart

lanStart = Val(txtbxLanNumber.Value)
numStart = Val(txtbxOSNumber.Value)
numStop = Val(txtbxNumberOS.Value)
numCells = 7 + numStop
hideStart = numCells + 1

Range("C8").Value = numStart
Range("C9:C" & numCells).Formula = "=R[-1]C3+1"
Range("B8:B" & numCells) = Val(txtbxLanNumber.Value)
Application.CutCopyMode = False
'--- I need a statement here to hide rows
'the starting row reference being the variable hideStart
'and the last row is 33

Me.MultiPage1.Value = 4

End Sub

My attempt

Rows(hideStart:"33").Hiiden = True

returns a syntax error

Can anyone point me in the right direction please.

Thanks in advance

Mark

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 92
Default Using a variable in a Rows Hidden Staement

That did the trick

Thank you very much

Mark

"Barb Reinhardt" wrote:

Try

Rows(hideStart & ":33").Hidden = True

"Mark Dullingham" wrote:

I want to hide a number of row in my work book and with help from a previous
post I can do this for a fixed number of rows

Rows ("5:7").Hidden = True

My new problem is in this instance the last row I want to hide is fixed bu
the first roe number is defined by the variable - hideStart in the code below

Private Sub Set_LanButton_Click()
Dim numStart&, numStop&, numCells&, lanStart&, hideStart

lanStart = Val(txtbxLanNumber.Value)
numStart = Val(txtbxOSNumber.Value)
numStop = Val(txtbxNumberOS.Value)
numCells = 7 + numStop
hideStart = numCells + 1

Range("C8").Value = numStart
Range("C9:C" & numCells).Formula = "=R[-1]C3+1"
Range("B8:B" & numCells) = Val(txtbxLanNumber.Value)
Application.CutCopyMode = False
'--- I need a statement here to hide rows
'the starting row reference being the variable hideStart
'and the last row is 33

Me.MultiPage1.Value = 4

End Sub

My attempt

Rows(hideStart:"33").Hiiden = True

returns a syntax error

Can anyone point me in the right direction please.

Thanks in advance

Mark

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
opening a group but keep hidden rows hidden MWL Excel Discussion (Misc queries) 0 February 17th 09 03:16 PM
Hidden rows columns won't stay hidden christie Excel Worksheet Functions 0 September 30th 08 05:44 PM
Formula or Code to keep Hidden Rows Hidden Carol Excel Worksheet Functions 6 May 1st 07 11:45 PM
I need my Hidden Rows to stay hidden when I print the sheet. Rosaliewoo Excel Discussion (Misc queries) 2 July 20th 06 07:51 PM
If staement and macro Kelly******** Excel Programming 7 July 2nd 06 12:51 AM


All times are GMT +1. The time now is 03:32 AM.

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"