Hi,
I need to make this code work for every line in column A and column F. Whats the easiest way of doing this?
Thanks!Please Login or Register to view this content.
Hi,
I need to make this code work for every line in column A and column F. Whats the easiest way of doing this?
Thanks!Please Login or Register to view this content.
This perhaps.
Please Login or Register to view this content.
Hi Tracer,
You can use this code it you don't know the maximum number of rows on your worksheet:
Hope this helps. Please let me know how you get on.Please Login or Register to view this content.
Regards,
Greg M
I decided to try it this way, so that the people using it don't have to run the macro. I keep getting the #VALUE! error though...
Cell "A2" = "PD93-L-1000-1"Please Login or Register to view this content.
Cell "F2" = "=GetDocumentType(A2)"
What am I doing wrong?
Well you've now changed from a Sub to a Function, specifically a user defined worksheet that you seem to be trying to use on a worksheet.
Firstly you aren't returning any value with the function and secondly you don't actually seem to be doing much with the parameter DocumentType.
Did you try any of the other code posted?
Yes I did try the other code and it works, but I wanted to try it this way so that they dont have to run the macro. DocumentType will just be a cell value to replace the "For iRow = 2 To ActiveSheet.Range("A65536").End(xlUp).Row" that Greg mentioned.Originally Posted by Norie
So F2,F3,F4... for me will be:
=GetDocumentType(A2)
=GetDocumentType(A3)
=GetDocumentType(A4)
etc...
What do you mean by the bolded part?
Found my mistake... I'm an idiot
The Code should read:
Please Login or Register to view this content.
Hi Tracer,
Glad to hear that things are working for you. Thanks for the feedback.
Regards,
Greg M
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks