Hi all,
I'm struggling with the last piece of my macro! Please help!
So far my macro does the following after it is run:
- Asks the user to select an excel file and then opens it
- Asks the user to select a range (of postcodes/zipcodes) within that file
- Then using the range the macro inserts a space 3 characters from the right in each cell
- Then it replaces all the 'O's with '0' (zeros)
- Then it inserts a column to the left of the range the user has selected.
What I need the macro to finally do is an if statement against a fixed range of correct postcodes/zipcodes which is located within the same workbook (that the macro is fired from). The sheet with the correct codes is called PDCS and the range with the correct codes is A1:A33679.
What I would like the if statement to do is to check each cell of the user defined range and put a 'Correct' or 'Incorrect' in the column that is to the left of the range the user has picked (as is created in step 5 above). The 'Correct' will appear for those where the code matches those in the PDCS list and 'Incorrect' for those that don't.
I know how to do this with a static range but not how to create it so it refers to the range that the user picks. I have pasted my code so far if it helps.
Thanks for any help you can provide.
Bookmarks