Hi
I am using checkboxes on a UserForm to call a macro but I have to have the required sheet active for the code to run. Even running the code from Visual Basic requires it and now puzzling me. Any suggestions or observations please
I am using checkboxes on a UserForm to call a macro but I have to have the required sheet active for the code to run. Even running the code from Visual Basic requires it and now puzzling me. Any suggestions or observations please
VBA Code:
Sub HideRecurring
Application.ScreenUpdating = false
With Sheets("TestSheet")
lastrow = Range("c" & Rows.Count).End(xlUp).Row
BeginRow = 4
EndRow = lastrow
ChkCol = 5
For RowCnt = BeginRow To EndRow
if Cells(RowCnt, ChkCol).Value = "0" then
Cells(RowCnt,ChkCol).EntireRow.Hidden = True
end if
Next RowCnt
end with
Application.ScreenUpdating = true
end sub