Robert Drummond
New Member
- Joined
- Feb 7, 2016
- Messages
- 1
I am a beginner with Macros for Excel. I want to create a Macro to hide rows in a spread-sheet if there is a blank in column 7. I found the following Macro on a website that did this which I think I have correctly entered.
Sub HURows()
BeginRow = 3
EndRow = 416
ChkCol = 7
For RowCnt = BeginRow To EndRow
If Cells(RowCnt, ChkCol).Value = “” Then
Cells(RowCnt, ChkCol).EntireRow.Hidden = True
Else
Cells(RowCnt, ChkCol).WntireRow.Hidden = False
End If
Next RowCnt
End Sub
It wont work. I have the workbook in Macro enabled form but when I click Developer, Macro, Run I get the message "Object doesn't support this property or method". I have tried changing the "" blank to a number as the column has currency amounts in it.
Sub HURows()
BeginRow = 3
EndRow = 416
ChkCol = 7
For RowCnt = BeginRow To EndRow
If Cells(RowCnt, ChkCol).Value = “” Then
Cells(RowCnt, ChkCol).EntireRow.Hidden = True
Else
Cells(RowCnt, ChkCol).WntireRow.Hidden = False
End If
Next RowCnt
End Sub
It wont work. I have the workbook in Macro enabled form but when I click Developer, Macro, Run I get the message "Object doesn't support this property or method". I have tried changing the "" blank to a number as the column has currency amounts in it.