Find Value One Sheet to another sheet & Update value

smartguy

Well-known Member
Joined
Jul 14, 2009
Messages
778
Hello all,

I have excel file in the below format.


Excel Workbook
BCDEF
5NameClassValueBlood groupTarge
6A12
7B12
8C10
9D12
10F12
11G12
12H12
13I12
14J12
15A12
Sheet1


I want to get data base on sheet 2.( Column "A" & "E")


Excel Workbook
ABCDEF
1NameValueBlood groupTargeClassexam
2A12312no
3Bsdfff12df
Sheet2


Answer :

Excel Workbook
BCDEF
5NameClassValueBlood groupTarge
6A12123
7B12sdfff
8C10
9D12
10F12
11G12
12H12
13I12
14J12
15A12123
Sheet1


Please help to Provide VBA Code....
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
Have you tried to record a macro to see what code it suggests?
 
Upvote 0
Are all the names unique? If so, have you tried to use VLOOKUP? And why can't you record macro's?
 
Upvote 0
Hi, Smaryguy. Try this:-
Code:
[COLOR="Navy"]Sub[/COLOR] MG10Mar01
[COLOR="Navy"]Dim[/COLOR] Rng [COLOR="Navy"]As[/COLOR] Range, Dn [COLOR="Navy"]As[/COLOR] Range
[COLOR="Navy"]Dim[/COLOR] nRng [COLOR="Navy"]As[/COLOR] Range, nDn [COLOR="Navy"]As[/COLOR] Range
With Sheets("Sheet2") '[COLOR="Green"][B]sht2[/B][/COLOR]
    [COLOR="Navy"]Set[/COLOR] nRng = .Range(.Range("A2"), .Range("A" & rows.Count).End(xlUp))
[COLOR="Navy"]End[/COLOR] With
With Sheets("Sheet1") '[COLOR="Green"][B]sht1[/B][/COLOR]
    [COLOR="Navy"]Set[/COLOR] Rng = .Range(.Range("A6"), .Range("A" & rows.Count).End(xlUp))
[COLOR="Navy"]End[/COLOR] With
[COLOR="Navy"]For[/COLOR] [COLOR="Navy"]Each[/COLOR] nDn [COLOR="Navy"]In[/COLOR] nRng
    [COLOR="Navy"]For[/COLOR] [COLOR="Navy"]Each[/COLOR] Dn [COLOR="Navy"]In[/COLOR] Rng
        [COLOR="Navy"]If[/COLOR] nDn = Dn And nDn(, 5) = Dn(, 2) [COLOR="Navy"]Then[/COLOR]
            Dn(, 3) = nDn(, 2)
            Dn(, 4) = nDn(, 3)
            Dn(, 5) = nDn(, 4)
        [COLOR="Navy"]End[/COLOR] If
    [COLOR="Navy"]Next[/COLOR] Dn
[COLOR="Navy"]Next[/COLOR] nDn
[COLOR="Navy"]End[/COLOR] [COLOR="Navy"]Sub[/COLOR]
Regards Mick
 
Upvote 0
Hi Mickg !!!

Great it's Working Fine...

thank-you.jpg


840275bkb2qbejdr.gif
 
Upvote 0

Forum statistics

Threads
1,224,607
Messages
6,179,871
Members
452,948
Latest member
UsmanAli786

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top