Hi all. What I am trying to do is have a comand buton on Sheet1, clear a range on sheet 2. This is what I have and it dont seam to work. (button in sheet1)
Private Sub Cmd1_Click()
Sheets("Sheet2").Select
Range("A1:D12").Select
Selection.ClearContents
Range("A1").Select
End
End Sub
I also tryed the same thing with a dbase query, and it does the same thing. As long as I run the button from the same sheet that I want to import the data too, everything is fine. But when running the comand from another worksheet,In the same workbook I end up with errors.
Thx for your help Dan
Private Sub Cmd1_Click()
Sheets("Sheet2").Select
Range("A1:D12").Select
Selection.ClearContents
Range("A1").Select
End
End Sub
I also tryed the same thing with a dbase query, and it does the same thing. As long as I run the button from the same sheet that I want to import the data too, everything is fine. But when running the comand from another worksheet,In the same workbook I end up with errors.
Thx for your help Dan