Locate & copy just two cells!

Daghs

New Member
Joined
Apr 17, 2021
Messages
14
Office Version
  1. 2010
Platform
  1. Windows
Hi

I have two files "Data.csv" & "Output.csv".

In data file just in column "B" I'd like to locate the word "JACK" (remember it would be just once in column "B" & I want to find that).
Now where it's located this cell & in the same row cell of column "A" (just these two cells).
I want to copy and paste it to the Output file's "A2" cell, one thing where I want to use this macro they still use excel 2010 so anyone could suggest any macro it'd be a great help.

Thanks
 
Hi,
You just got me a relief from a headache,
I really mean it thanks!
I'm sorry but I have to ask one thing more,
Here we are finding in column "B" and in the same row copying from column"A" as well
What if instead of column "A" we got column"D"
What would be the change in the code!
Thanks again for the help what nobody else did you did, thanks a lot!
 
Upvote 0

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
No problem, happy to help.
Just change the one line that does cells in columns A & B to 2 lines, see below.
Let me know if you need help with it.
VBA Code:
mainSht.Range("B2").Value = csvSht.Range("B" & csvRow).Value
mainSht.Range("D2").Value = csvSht.Range("D" & csvRow).Value
 
Upvote 0

Forum statistics

Threads
1,215,634
Messages
6,125,938
Members
449,275
Latest member
jacob_mcbride

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