junebug
01-31-2019, 09:47 AM
Hi
I need help converting this formula to a macro
Formula :=IF(LEN(A2)=6,"XXX-0000"&A2,A2)
for example if i have "121213" in col A2, I would like to have a code that will count the characters in the cell, confirm it has 6 characters in the cell, and then if it is 6, i would like it to become "XXX-000012123". if not 6 characters, i want it to leave it as is
The formula above will do this, i just dont know how to convert it to a macro.
Thank you
I need help converting this formula to a macro
Formula :=IF(LEN(A2)=6,"XXX-0000"&A2,A2)
for example if i have "121213" in col A2, I would like to have a code that will count the characters in the cell, confirm it has 6 characters in the cell, and then if it is 6, i would like it to become "XXX-000012123". if not 6 characters, i want it to leave it as is
The formula above will do this, i just dont know how to convert it to a macro.
Thank you