|
-
Jan 24th, 2011, 03:49 PM
#1
Thread Starter
Addicted Member
[RESOLVED] Replacing cells in one wksht with lookup from another
Next step in my current project, I need to move user's data from worksheets that I have imported from an older workbook in VBA.
I'm not quite sure how to do a quick replace of the contents. I can manually type the following formula in one of the cells of the worksheet to be updated (the source worksheet is named 'SOURCE' here):
=VLOOKUP((A11),SOURCE!A11:V11,15)
And this will show the proper lookup value, but I would like to set the contents to the values (not the formula) in the corresponding cells using VBA. I need to replace columns 12 through (last used column) for all of the cells from row 11 to the last row, based on the lookup value in column 1. Do I need to loop through each row, and then loop through each column, or can I replace the contents of the entire range with a single command?
My next steps will be marking rows that are in the destination worksheet that don't exist in the source worksheet ('New'), and then duplicating rows in the source that don't exist in the destination and marking those as 'Deleted'.
I appreciate any assistance that anyone can provide.
Last edited by MarkWalsh; Jan 24th, 2011 at 03:52 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|