VBA How to get county out of the Address block and put it under County's column?

vbanewbie68

Board Regular
Joined
Oct 16, 2021
Messages
171
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
Hi Sir/Madam

Please find attached.

I want to tell macro to get off "West Sussex" under Donor Address line 1's column ,the last end, and then paste it into the Donor County's column? and Also how to remove commas as well Please? I have a list of hundreds like that.

Thank you in advance :)

Best Regards

V
 

Attachments

  • Address block.png
    Address block.png
    121.2 KB · Views: 15
For each row in my sample above, what would the message box say?
What would happen if we click Yes? (That is, what would go in column D and what would go in column F?)
What would happen if we click No? (That is, what would go in column D and what would go in column F?)
 
Upvote 0

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
"Potential County Match please check" msgbox
If match then click yes then pull true value out of column D and put it Column F.
If no match then click No. No action is needed.

Hope it helps

Regards

V
 
Upvote 0
We seem to be going round in circles and I am just about done.

From the table of counties (another workbook or worksheet) to find/search what Match county in the address block.
Row 7 of my sample has no matches so I have no idea what to do if you answer 'Yes' or 'No' to the message box which says "Potential County Match please check" when there is no potential match.

Row 8 of my sample has 3 matches so I have no idea what to do if you answer 'Yes' or 'No' to the message box which says "Potential County Match please check".
 
Upvote 0
Okay. I will have a go for myself creating a macro you provided, thanks for that and then to add new code in relation to counties check. I will update you if that is okay with you
Many thanks again for your time on this matter which is much appreciated. :). I have learnt lots from you on vba.

Best regards
 
Upvote 0

Forum statistics

Threads
1,215,868
Messages
6,127,408
Members
449,382
Latest member
DonnaRisso

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