ColinCoady
New Member
- Joined
- Mar 21, 2019
- Messages
- 35
If I run this code as a macro it works fine but put same code in for a command button and I get a Run-time error '1004': Select method of range class failed.
Anyone help with a fix?
This is where the debug stopped in the code:
Anyone help with a fix?
This is where the debug stopped in the code:
Rich (BB code):
Private Sub CommandButton3_Click()
'
' DeleteInputData Macro
' Deletes input data cells on sheets and objects
'
'
Dim sh As Shape
Range("B3:B11,B13:E13,B14:F14,B15").Select
Range("B15").Activate
Selection.ClearContents
Range("B3").Select
Sheets("Costing").Select
Range("A9:C17,D9,D12,D15,D18,B20,B22,B24").Select
Range("B24").Activate
Selection.ClearContents
Range("D9").Select
Sheets("Docs").Select
For Each sh In ActiveSheet.Shapes
sh.Delete
Next sh
Sheets("InfoEntry").Select
Range("B3").Select
End Sub