Home |
Search |
Today's Posts |
#7
![]() |
|||
|
|||
![]()
This portion of your code looks suspicious:
Workbooks("counts.csv").Worksheets("summary").Cell s(2, 2).Value When I open a .CSV file, the worksheet name is based on that file name. If you change that worksheet name to Summary, then ignore this. But this is one time I would use: Workbooks("counts.csv").Worksheets(1).Cells(2, 2).Value to get that first (and only) worksheet in the .CSV file. wrote: Thanks Dave + others, "How would you ever know which workbook is workbooks(1) and which is workbooks(2)? " was a good question / point. I was also copying the wrong cells. The working code is now: Sub Copy_Cell_from_2ndbook_to_1st_book() ' Copy 2nd book's B2 (2,2) to 1st book's E2 (2,5) Workbooks("Book1.xls").Worksheets("sheet1").Cells( 2, 5).Value = _ Workbooks("counts.csv").Worksheets("summary").Cell s(2, 2).Value MsgBox "Done" End Sub -- Dave Peterson |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
hpw do I logic test a cell then copy the row to diff. SS | Excel Worksheet Functions | |||
copying cell names | Excel Discussion (Misc queries) | |||
Copy cell format to cell on another worksht and update automatical | Excel Worksheet Functions | |||
How can I copy a cell from one page to all pages of a workbook? | Excel Worksheet Functions | |||
GET.CELL | Excel Worksheet Functions |