• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Macro for copying data from sheet"data" to sheet PL

Nilay

New Member
Sheet "Data" contains a list of accounts & values. Sheet "PL" contains the same list of accounts , however it is jumbled up (cannot be sorted) & has other data in between.
If you refer the sheet PL in the uploaded workbook , I have highlighted the accounts which are available in sheet "Data".
I need a macro which can update the values from sheet "Data" into sheet "PL". if possible a command button in sheet PL would be a great help.
Thanks!
 

Attachments

  • Copy SHeet.xls
    16 KB · Views: 6
Dear Nilay

Why you are prefering for VBA code to do this. Excel built in functions can do this for you without using the VBA code. Please enter the below formula in sheet "PL" cell B12 and drag it down.

=IFERROR(VLOOKUP(A12,Data!$A$3:$B$31,2,FALSE),"")

Please inform if anything goes wrong.
 
Hi, Nilay!

As a new user you might want to (I'd say should and must) read this:
http://chandoo.org/forum/forums/new-users-please-start-here.14/

And regarding your issue and before considering if the best solution is using formulas or VBA code, please clarify this:
a) You want to update cells in worksheet Data with information in cells of worksheet PL.
b) Which rows of 2nd worksheet do you want to update? Only those that exist (update), add new ones, delete those that doesn't exist any more, ...
c) What do you mean by update? Work with Account (col A) or with Amount (column B) too?
d) If with column B too, which type of update are you looking for? Replacing values, adding/subtracting values, or setting values to a particular amount.

Regards!
 
Back
Top