Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copying data into a cell in an Excel file using named range and row 2

Status
Not open for further replies.

LizF

Technical User
Feb 7, 2003
30
PT
Hello folks,

Thanks to the help received in response to my previous question, things are progressing well with my code. However, I'm stumped again!!

My client Excel file is a large spreadsheet. Each Row contains a number i.e. z12345 along with a load of other information. My code can now pick up the z-number and compare it with a bunch of smaller server files to find the one(s) with the same z-number in their filename. Now I need to copy data from certain cells in that matched server file into cells in the large client spreadsheet, in the row containing that z-number. The columns are named ranges, so is there any way of specifying e.g. for row containing z12345, range "Summary", copy xyz?? i.e can I use the range as if it were a column to pinpoint a cell I need to copy into?

Example....

Z-number Summary Actions Attendance Cost
z12345 78 86 56 67
z23456 89 69 98 95
z45123
z76124
etc...

Thanks in advance...
Liz
%-)
 
A named range acts just like any other range - it has rows and columns (in this case only 1 column). So you need something like :-

Activesheet.Range("Summary").Cells(100,1).Value = _
FromSheet.Cells(Foundrow,1).Value Regards
BrianB
** Let us know if you get something that works !
================================
 
I'm not entirely sure what you're trying to achieve, but I think the following may help:

If you have a row variable iRow which contains the row of the proper z-number, you can do:

range("summary").cells(iRow,1).select
activesheet.paste

to paste into that cell in your table. Does that help?
Rob
[flowerface]
 
Thanks guys, just what I needed....

Liz
:-D
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top