Command button failure
Why does the following fail @ Range("D2").Select
Rum-time error '1004" Application-defined or object-defined error If I run the exact same code in a Macro it works fine Private Sub CommandButton1_Click() Workbooks.Add ActiveWorkbook.SaveAs Filename:="TempData.xls" Windows("testbook.XLS").Activate Range("D2:D7").Select Selection.Copy Windows("TempData.XLS").Activate Range("D2").Select ActiveSheet.Paste End Sub |
Command button failure
Hello!
I change one row, and it works me! Workbooks("TempData.XLS").Sheets(1).Range("D2").Se lect Regards Kari J Keinonen |
Command button failure
When I replace "Windows("TempData.XLS").Activate" with
Workbooks("TempData.XLS").Sheets(1).Range("D2").Se lect I get a 1004 "Select method of Range class failed" at this new line oldjay "Kari J Keinonen" wrote: Hello! I change one row, and it works me! Workbooks("TempData.XLS").Sheets(1).Range("D2").Se lect Regards Kari J Keinonen |
Command button failure
Hy!
I don't replace that row. Regards Kari J Keinonen "Oldjay" wrote: When I replace "Windows("TempData.XLS").Activate" with Workbooks("TempData.XLS").Sheets(1).Range("D2").Se lect I get a 1004 "Select method of Range class failed" at this new line oldjay "Kari J Keinonen" wrote: Hello! I change one row, and it works me! Workbooks("TempData.XLS").Sheets(1).Range("D2").Se lect Regards Kari J Keinonen |
Command button failure
What row did you replaced??
"Kari J Keinonen" wrote: Hy! I don't replace that row. Regards Kari J Keinonen "Oldjay" wrote: When I replace "Windows("TempData.XLS").Activate" with Workbooks("TempData.XLS").Sheets(1).Range("D2").Se lect I get a 1004 "Select method of Range class failed" at this new line oldjay "Kari J Keinonen" wrote: Hello! I change one row, and it works me! Workbooks("TempData.XLS").Sheets(1).Range("D2").Se lect Regards Kari J Keinonen |
All times are GMT +1. The time now is 04:13 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com