I've been trying to create a macro with AI help but I couldn't get a code to work. I'm going to post the code that i have and it does some of the thing that i want, like adding columns. i will submit a file (fictitious data) but it will give you an idea of what i need to accomplish. this is what i have and it works so far, except for the formulas (haven't tested those yet).
the part that i need to help with is the following:
1. I have data in Columns "G", "H" and "I". stored as text. i want to add a leading zero in Column G to any existing number (2,3,9) and get the value to be shown as '02,'03 and '09.
2. In Column H, i have 3 digits numbers , also as text and i want to add a leading zero so that all numbers have four numbers total, i have '299. '497.'499 etc. s/b '0299,'0497 etc
3. In column I, i have a 2 digit number , as text. i want number 99 to be converted to '00.
4. i have a total of about 215 rows but number could varied.
Please let me know if you have any questions and thank you in advance for all your help. you are the best!
VBA Code:
Sub UpdateSheet()
Dim ws As Worksheet
Set ws = ActiveSheet
ActiveSheet.Select
Range("K1").Value = "BU"
Range("M1").Value = "GL"
Range("N1").Value = "-"
Range("O1").Value = "00"
' Set color
ws.Range("G1,I1,K1,M1").Interior.Color = RGB(165, 214, 167)
Range("K2").Formula = "=VLOOKUP(H2,reference!$A$1:$B$21,2,0)"
Range("M2").Formula = "CONCATENATE(G2,N2,H2,N2,O2,N2,I2,N2,""60055-000"")"
the part that i need to help with is the following:
1. I have data in Columns "G", "H" and "I". stored as text. i want to add a leading zero in Column G to any existing number (2,3,9) and get the value to be shown as '02,'03 and '09.
2. In Column H, i have 3 digits numbers , also as text and i want to add a leading zero so that all numbers have four numbers total, i have '299. '497.'499 etc. s/b '0299,'0497 etc
3. In column I, i have a 2 digit number , as text. i want number 99 to be converted to '00.
4. i have a total of about 215 rows but number could varied.
Please let me know if you have any questions and thank you in advance for all your help. you are the best!