Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
opening a group but keep hidden rows hidden | Excel Discussion (Misc queries) | |||
Hidden rows columns won't stay hidden | Excel Worksheet Functions | |||
Formula or Code to keep Hidden Rows Hidden | Excel Worksheet Functions | |||
I need my Hidden Rows to stay hidden when I print the sheet. | Excel Discussion (Misc queries) | |||
If staement and macro | Excel Programming |