0

Very new to writing macros, trying to impress the boss with a project, but I am stuck with a code. I can hide the rows when the checkbox is selected, but the other checkboxes are still visible. Is there a way to hide other checkboxes as well. My current code:
Private Sub CheckBox20_Click()
If CheckBox20.Value = True Then
Range("A64:P82").EntireRow.Hidden = True
End If
If CheckBox20.Value = False Then
Range("A64:P82").EntireRow.Hidden = False
End If
End Sub

I want to hide CheckBox22 - CheckBox34.

2
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by Gizzle72
0

You need to use the following methods:

With ActiveSheet
.Range("C7").Value = .Range("C8").Value
.Range("D7").Value = .Range("D8").Value
.Range("E7").Value = .Range("E8").Value
.Range("F7").Value = .Range("F8").Value
End With

0

I have tested the macro and the checkboxes still appear when the rows are hidden:
Private Sub CheckBox20_Click()
If CheckBox20.Value = False Then
Range("A64:P82").EntireRow.Hidden = True
End If
If CheckBox20.Value = True Then
Range("A64:P82").EntireRow.Hidden = False
End If
With ActiveSheet
.Range("E65").Value = .Range("F65").Value
.Range("E70").Value = .Range("F70").Value
.Range("E73").Value = .Range("F73").Value
.Range("E76").Value = .Range("F76").Value
.Range("E79").Value = .Range("F79").Value
.Range("E82").Value = .Range("G82").Value = .Range("I82").Value
End With
End Sub

Perhaps I have written it incorrectly? Should it be two separate macros or is one as I have done okay?

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.