![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Mar 2002
Posts: 33
|
Hiya! I am having trouble with the syntax required to extract values from a closed workbook and place them into the active workbook. Here is what I need to do: I have an employee data file that has the first name in row B and the last name in row C. I need to loop through 75 lines and use the & command to place the full employee name in cell A1, A2, A3 etc of the open workbook.
Example. The employee file is employee.xls. B1 = John C1 = Doe Copy and paste "John Doe" into cell A1 of the active open workbook. Thanks in advance |
|
|
|
|
|
#2 | |
|
Board Regular
Join Date: Feb 2002
Posts: 7,743
|
Quote:
|
|
|
|
|
|
|
#3 |
|
New Member
Join Date: Mar 2002
Posts: 33
|
Yes, but because the cell reference is R1C1 I am not able to use looping variables. I need to be able to change the row number each time I pass through the loop. I believe the only way to do it is using something like
Dim x As Integer for x = 1 to 75 (Here is where I go out of range) activecell.value = Workbooks("C:My Documentsemployees.xls).Worksheets(1).cells(x,1) or something along these lines... Any other suggestions? |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|