Hello,
I tried to search this topic here but could not find it, so I wonder if you could help me with my scripts.
Basically I have a lot of data in form of XYYZZ where X is a characters and YY and ZZ are numeric (e.g A1126, A1926 etc). For each combination of X and Y I want to get the maximum number of YY so I came up with the following scripts:
Sub get_max()
Dim X, XRow, Yr, Pk, Seq
Dim A11, A16, A21, A26, A31, A36, A41, A50
Dim I11, I16, I21, I26, I31, I36, I41, I50
Dim P11, P16, P21, P26, P31, P36, P41, P50
Sheets("Register").Activate
XRow = [g1048576].End(xlUp).Row
For X = 3 To XRow
Yr = Right(Cells(X, 7), 2)
Seq = Mid(Cells(X, 7), 2, 2)
Pk = Left(Cells(X, 7), 1)
Pk & Yr = Seq
Next
End sub
The script fails when evaluates the variable Pk & Yr = Seq, is there a way to form a variable from variables ?
Thanks in advance for your help.
I tried to search this topic here but could not find it, so I wonder if you could help me with my scripts.
Basically I have a lot of data in form of XYYZZ where X is a characters and YY and ZZ are numeric (e.g A1126, A1926 etc). For each combination of X and Y I want to get the maximum number of YY so I came up with the following scripts:
Sub get_max()
Dim X, XRow, Yr, Pk, Seq
Dim A11, A16, A21, A26, A31, A36, A41, A50
Dim I11, I16, I21, I26, I31, I36, I41, I50
Dim P11, P16, P21, P26, P31, P36, P41, P50
Sheets("Register").Activate
XRow = [g1048576].End(xlUp).Row
For X = 3 To XRow
Yr = Right(Cells(X, 7), 2)
Seq = Mid(Cells(X, 7), 2, 2)
Pk = Left(Cells(X, 7), 1)
Pk & Yr = Seq
Next
End sub
The script fails when evaluates the variable Pk & Yr = Seq, is there a way to form a variable from variables ?
Thanks in advance for your help.