SiameseCat
IS-IT--Management
I am trying to copy a cell or range of cells from one worksheet to another. In doing so, I used Range(cell name).Select, then Selection.Copy. Afterward, I activated a new workbook, then selected a sheet, and finally attempted to select the range that I wanted to copy to on the destination sheet. My macro code follows:
Private Sub cmd_Copy_Click()
Dim wksheet As String
wksheet = InputBox("Please enter the name of the worksheet where you want to copy the data:", "Alpha-Liberty Company"
Sheets("Rice Lake"
.Select
Range("A12"
.Select
Selection.Copy
Windows("WeightCert.XLT"
.Activate
Sheets(wksheet).Select
Range("A7:A7"
.Select
End Sub
Upon executing the code I get error 1004: "Select method of Range class failed." "Rice Lake" is the source sheet, and the user inputs the destination sheet.
Anybody want to offer a suggestion as to what to do? I even tried to record a macro to do this, and I got the same message.
Paul Dadosky
Private Sub cmd_Copy_Click()
Dim wksheet As String
wksheet = InputBox("Please enter the name of the worksheet where you want to copy the data:", "Alpha-Liberty Company"
Sheets("Rice Lake"
Range("A12"
Selection.Copy
Windows("WeightCert.XLT"
Sheets(wksheet).Select
Range("A7:A7"
End Sub
Upon executing the code I get error 1004: "Select method of Range class failed." "Rice Lake" is the source sheet, and the user inputs the destination sheet.
Anybody want to offer a suggestion as to what to do? I even tried to record a macro to do this, and I got the same message.
Paul Dadosky