Vonsteiner
New Member
- Joined
- Apr 14, 2014
- Messages
- 45
- Office Version
- 365
- Platform
- Windows
Hello,
I am trying to clear the contents of specific cells based on whether a separate cell is TRUE or FALSE. Here is the macro I am using.
Sub ClearCells()
Worksheets("Project Description").Activate
If Cells(2, 8).Value = "FALSE" Then Cells(24, 2).ClearContents
If Cells(3, 8).Value = "FALSE" Then Cells(24, 3).ClearContents
If Cells(4, 8).Value = "FALSE" Then Cells(24, 4).ClearContents
If Cells(5, 8).Value = "FALSE" Then Cells(25, 2).ClearContents
If Cells(6, 8).Value = "FALSE" Then Cells(25, 3).ClearContents
If Cells(7, 8).Value = "FALSE" Then Cells(25, 4).ClearContents
If Cells(8, 8).Value = "FALSE" Then Cells(26, 2).ClearContents
If Cells(9, 8).Value = "FALSE" Then Cells(26, 3).ClearContents
If Cells(10, 8).Value = "FALSE" Then Cells(26, 4).ClearContents
End Sub
I am sure I am just overlooking something but I can't seem to figure it out. Any help would be greatly appreciated. Thank you.
I am trying to clear the contents of specific cells based on whether a separate cell is TRUE or FALSE. Here is the macro I am using.
Sub ClearCells()
Worksheets("Project Description").Activate
If Cells(2, 8).Value = "FALSE" Then Cells(24, 2).ClearContents
If Cells(3, 8).Value = "FALSE" Then Cells(24, 3).ClearContents
If Cells(4, 8).Value = "FALSE" Then Cells(24, 4).ClearContents
If Cells(5, 8).Value = "FALSE" Then Cells(25, 2).ClearContents
If Cells(6, 8).Value = "FALSE" Then Cells(25, 3).ClearContents
If Cells(7, 8).Value = "FALSE" Then Cells(25, 4).ClearContents
If Cells(8, 8).Value = "FALSE" Then Cells(26, 2).ClearContents
If Cells(9, 8).Value = "FALSE" Then Cells(26, 3).ClearContents
If Cells(10, 8).Value = "FALSE" Then Cells(26, 4).ClearContents
End Sub
I am sure I am just overlooking something but I can't seem to figure it out. Any help would be greatly appreciated. Thank you.