Search : in
By :

Excel Multi select VBA Coding

Last answer on Jun 10, 2009 3:48:26 pm BST LakeShow, on Jun 10, 2009 9:55:00 am BST 
 Report this message to moderators

Hello,

I have a VBA problem that I cannot seem to get my head round. I have two sheets (aptly named A and B).

In Sheet A I have a list of names with costings (values) to the right.
In Sheet B I have a list of names with no costings (values) to the right.

I would like to design a Macro that will take the first name in Sheet A, find that name in Sheet B, copy the costings associated with that name in Sheet A and paste them in Sheet B.

From there, the Macro should proceed to select the next name down on Sheet A, and do the same.

So it would be a loop until the names on Sheet A are done.

Please not thatm some names on Sheet B, may not appear on Sheet A and vice versa

Thank you in advance

Configuration: Firefox 3.0.10

Best answers for « Excel Multi select VBA Coding » in :
Adding a VBA CommandButton with its respective the code ShowAdding a VBA CommandButton with its respective the code Paste these two sub in a general module (Module1 for example). Sub CreateButton() Dim Obj As Object Dim Code As String Sheets("Sheet1").Select 'create button ...
Connect a database (MDB) to excel Show[VBA] Connecting a database (MDB) to excel Below is a tips of how to connect an Access database (MDB) in an application excel Add reference Microsoft DAO object librairy X.X In a general module (eg Module1) paste the code below...
[VBA: VB6] Using excel from another application Show[VBA: VB6] Using excel from another application Here is a little routine to call Excel from VB6 or another Office application. Paste in a general module (eg Module1) In VBA>> Insert>> Module and paste in the window ... In VB6>>...
Hyperlinks ShowIntroduction to anchors Hypertext links or hyperlinks (anchors) are HTML elements that, when clicked on, enable readers to visit a new address. Hyperlinked text is underlined by default. Hyperlinks are what connect web pages to one another. They...

1

Excelguru, on Jun 10, 2009 12:35:23 pm BST
  • +1

Hi

you can do it without a macro
Put the following formula in cell B1 of sheet 2 (Assumes the name is in column A)
=if(iserror(vlookup(A1,sheet1!A:A,2,false) ),"",vlookup(A1,sheet1!A:A,2,false)) and drag it down

If you want a macro record your above activity Winners are losers who got up and gave it one more try. -Dennis DeYoung
My Interests are financial Modelling and custom excel development.

Reply to Excelguru

2

 LakeShow, on Jun 10, 2009 3:48:26 pm BST
  • +1

Hey thanks for that. I ended up using the Index & Match function which worked well.

Awesome!!

Reply to LakeShow