Can 1 cell be copied from another workbook, copied to this one, run code, and then loop through all until done?

HopefulGJL

Board Regular
Joined
Nov 28, 2008
Messages
100
Hello,

I have the below code that runs everything in the referenced code.

What I'm looking to do is have it loop through a list, perform everything in those two codes one-by-one. The list is in an external workbook. I'll try to clarify this:

Take the name in Sheet1 B1 of the other workbook and paste in to this workbook Sheet1 A1.
Now do both of the below codes.
Next take the name in Sheet1 B2 of the other workbook and paste in to this workbook Sheet1 A1.
Now do both of the below codes.
Keep going until each is completed.

I have looked at many examples from online searches, but just can't find something that copies the cells one by one from another workbook to do codes in this workbook and then continue to the next.

Thanks in advance for any assistance you can provide.

VBA Code:
Sub Main()
AutoFilterColumnCellValue
BreakLinksandSave
End Sub
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
I think I've got something close, but for some reason it's only doing the first one and not continuing to loop through the list.
Note: I "gave up" on trying to this from another workbook, and just manually copied/pasted what I need in to the workbook I have almost everything else in for now.

How could this be adjusted so that it loops through each while then doing the other two codes before it loops?

VBA Code:
Sub Main()


Dim columnBI As Range
Dim target As Range


Set columnBI = Range("BI1:BI" & ActiveSheet.Cells.SpecialCells(xlCellTypeLastCell).Row)
Set target = Range("A1")
For Each c In columnBI
    target = c


 AutoFilterColumnCellValue
 BreakLinksandSave
 
 Next c
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,839
Messages
6,121,892
Members
449,058
Latest member
Guy Boot

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