Excel VBA code not working - simple?

Associate
Joined
15 Mar 2006
Posts
2,097
I can't get a line of code to work, and I can't see why.

Private Const Block1Upper As Double = 4 (Or Integer)
Private Const Block1Lower As Double = 18 (Or Integer)

Private Sub CommandButton1_Click()
If CommandButton1.Value = False Then
// works fine
Rows("4:18").Hidden = False
// doesnt work
Rows("Block1Upper :Block1Lower").Hidden = False
End If
End Sub


// comments are obviously not in the actual code.

The constants are defined properly, because they work when I do
Rows(Block1Lower).Hidden = False



Any ideas?


* Took all day, but finally got it working with Rows(Block1Upper & ":" & Block1Lower).Hidden = False
 
Last edited:
Back
Top Bottom