Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Run-time 1004 error on range select
Hello, I have a command button on Sheet1 that I use to insert a new column o that sheet, but now need it to also copy column "A" on Sheet2 to th first blank column on that sheet. Here is what I have: Private Sub CommandButton2_Click() ' Insert new column on Sheet1 ActiveCell.Select Selection.EntireColumn.Insert Shift:=xlToRight Dim src As Range Dim dest As Range Set src = Cells("2", ActiveCell.Column + 1) Set dest = Cells("2", ActiveCell.Column) src.Copy dest ' copy column on Sheet2 Sheets("sheet2").Activate Columns("A").Select Selection.Copy Range("E1").End(xlToRight).Select Selection.EntireColumn.Select ActiveSheet.Paste End Sub But, it seems like no matter how I phrase the range select on Sheet2, get a run-time 1004 error: select method of range class failed. I'v also tried: ' copy column on Sheet2 Sheets("sheet2").Activate Range("A1").Select Selection.Copy but still get the same error. Any suggestions would be appreciated. Thank you ----------------------------------------------- ~~ Message posted from http://www.ExcelTip.com ~~View and post usenet messages directly from http://www.ExcelForum.com |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Run-time error '1004': AutoFill method of Range class failed | Excel Discussion (Misc queries) | |||
Run-time error '1004': AutoFill method of Range class failed | Excel Discussion (Misc queries) | |||
Run-Time error '1004' : Select method of Range class failed | Excel Discussion (Misc queries) | |||
Run-time error "1004" Select method of range class failed | Excel Discussion (Misc queries) | |||
error 1004 Select method of Range class failed | Excel Programming |