Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel Macro to Hide rows based on user input.

Status
Not open for further replies.

JayRD

Technical User
Dec 14, 2005
9
0
0
US
Can anyone tell me what's wrong with this macro.
I want the macro to hide all the rows greater or equal to ct.

Sub Macro2()
'
' Macro2 Macro
'
Dim Atest As Range

ct = Worksheets("Step One").Cells(24, "E").Value
Set Atest = Range(Worksheets("Sheet2").Cells(A, ct), Worksheets("Sheet2").Cells(A, 65536))
Atest.EntireRow.Hidden = True

End Sub
 
Perhaps this ?
Worksheets("Sheet2").Rows(ct & ":65536").Hidden = True

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top