VBA loop - find help

kwilli39

New Member
Joined
Oct 27, 2011
Messages
3
Here's my situation. I have a workbook called 'delinqs'. This is my goto summary book that I use for multiple things. But I want to open 2 other workbooks 'debts' and 'dealfile' on hard drive which I already have mapped out the address to in 2 cell ranges on original 'delinqs' file.

-I know how to open these files and close them using vba-.

Here is my real problem that I cant figure out how to do----

I want to find a value in the first workbook opened 'debts'. For each cell that has this value, could be 1 or could be 6 times value is found. I then want to move over one cell to right, remember that loan number and then look in 'dealfile' to find those remembered loan numbers and then paste the letter "x" in column AV for each one that was found.

Hope this makes sense. Any help would be great. I know I have to use some kind of loop I'm thinking.
Thanks.
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
heres some code and notes that may help

Sub TOTAL_DEBT()
'filenames
file1 = Range("debts").Value
file2 = Range("dealfile").Value

Workbooks.Open Filename:=file1

'here insert what you want to find and code to find it. there could be multiple cells that need to be found. everything that needs to be found will be in column a though.
'then move over one cell to right and remember whatever value is in that cell.
'now open next file and find that remembered value and move over to column AV and paste "x" into that cell.

Workbooks.Open Filename:=file2

'repeat for however many values were found in file1
 
Upvote 0

Forum statistics

Threads
1,223,246
Messages
6,170,999
Members
452,373
Latest member
TimReeks

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