Dr. Demento
Well-known Member
- Joined
- Nov 2, 2010
- Messages
- 618
- Office Version
- 2019
- 2016
- Platform
- Windows
I'm attempting to modify a small sub that hides columns based on a key string in the header. I'm getting hung up on two points 1) passing the row number of the header and 2) setting the location of the activecell as the default header location. Here's a failing attempt.
When I use the statement above, the text is red/won't run.
I've attempted to take out the ByRef and place it within the sub ( row_Hdr as Variant); it returns null (clearly not correct).
All suggestions welcome.
Thanks, y'all.
Code:
Sub Hide_Column(strHeader As String, ByRef row_Hdr As Range = ActiveCell.EntireRow.Calculate)
When I use the statement above, the text is red/won't run.
I've attempted to take out the ByRef and place it within the sub ( row_Hdr as Variant); it returns null (clearly not correct).
All suggestions welcome.
Thanks, y'all.