Updating one worksheet from another

routrax

New Member
Joined
May 18, 2006
Messages
5
Hi Guys n Gals,

I'd like to compare 2 spreadsheets and if 2 cells in a row on spreadsheet a match 2 cells in a row on spreadsheet b the a value from a certain cell in b is copied in to a.

i hope this makes sense!

Cheers
Routrax
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).

ravishankar

Well-known Member
Joined
Feb 23, 2006
Messages
3,566
What you ask is possible. but you should tell us more precisely what and how you want it done.
The code below runs for 100 rows, compares corresponding cells of sheet 1 to sheet 2 and if 2 or more cells match it copies the value in G column of sheet 2 to K column of sheet 1.

for a = 1 to 100
if cells(a,1) = worksheets("sheet2").cells(a,1)
b = b + 1
if b > = 2 then
cells(a,11) = worksheets("sheet2").cells(a,7)
endif
endif
next a

you have to change the cell numbers to suit your needs

Ravi
 

Forum statistics

Threads
1,141,023
Messages
5,703,806
Members
421,318
Latest member
cg_cartoonexcel

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
Top