michaelsmithgall
New Member
- Joined
- Feb 22, 2011
- Messages
- 19
i wasnt sure how to explain this the header
I have a simple peice of code that clears a few cells. I went back and added another row and therefore updated the code. Now when click the button all my other cells clear as supposed to but my new one doesnt.. but if i run the moduile within the VBA window it works as expected.
The cell that isnt working is D4. i also tried running it with D2:D6 but that didnt work either. I cant figure it out
Private Sub ClearMDL_Click()
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Range("H14:H82").Select
Selection.ClearContents
Range("D2:D4").Select
Selection.ClearContents
Range("D5:D6").Select
Selection.ClearContents
Range("D8:D11").Select
Selection.ClearContents
Range("D22:D36").Select
Selection.ClearContents
Range("B40").Select
Selection.ClearContents
Sheets("MDL").Select
Application.ScreenUpdating = True
Application.DisplayAlerts = True
End Sub
I have a simple peice of code that clears a few cells. I went back and added another row and therefore updated the code. Now when click the button all my other cells clear as supposed to but my new one doesnt.. but if i run the moduile within the VBA window it works as expected.
The cell that isnt working is D4. i also tried running it with D2:D6 but that didnt work either. I cant figure it out
Private Sub ClearMDL_Click()
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Range("H14:H82").Select
Selection.ClearContents
Range("D2:D4").Select
Selection.ClearContents
Range("D5:D6").Select
Selection.ClearContents
Range("D8:D11").Select
Selection.ClearContents
Range("D22:D36").Select
Selection.ClearContents
Range("B40").Select
Selection.ClearContents
Sheets("MDL").Select
Application.ScreenUpdating = True
Application.DisplayAlerts = True
End Sub