Hi All, I have compiled this code, but I want to tidy this up and if possible, have arrays so that it would be easier to add more variables in the future.
In a nutshell I want the macro to look at Column AA for anything in the array AND if column AC has a specific text to then give me the result in Column AC, which my code does, but everytime I have a new varient for the array, the code looks more and more untidy. I feel if I have an array that would look for X, Y, Z and another that looks for A,B,C,D and another array for F,G,H,I,J - AND the merchant name, to then change the merchant name to type as well (thats just a simple rename) I'm just getting stuck on the Array element, my code is:
Any help would be much appreciated, I feel like I am going around in circles at the moment.
In a nutshell I want the macro to look at Column AA for anything in the array AND if column AC has a specific text to then give me the result in Column AC, which my code does, but everytime I have a new varient for the array, the code looks more and more untidy. I feel if I have an array that would look for X, Y, Z and another that looks for A,B,C,D and another array for F,G,H,I,J - AND the merchant name, to then change the merchant name to type as well (thats just a simple rename) I'm just getting stuck on the Array element, my code is:
VBA Code:
iCell = 1
Do Until Range("AC" & iCell) = ""
If Range("AC" & iCell).Offset(0, -24) = "AmEx" Then
Range("AC" & iCell).Value = "Books03 AmEx"
GoTo NxtLine
ElseIf Range("AC" & iCell).Offset(0, -2) Like "*?????PW*" Or Range("AC" & iCell).Offset(0, -2) Like "*200#####*" Or Range("AC" & iCell).Offset(0, -2) Like "*????pw*" And Range("AC" & iCell) = "Books03" Then
Range("AC" & iCell).Value = "Books03 Upload"
ElseIf Range("AC" & iCell).Offset(0, -2) Like "*.*.*.*" Or Range("AC" & iCell).Offset(0, -2) Like "* *.*.*" And Range("AC" & iCell) = "Books03" Then
Range("AC" & iCell).Value = "Books03 F28"
End If
NxtLine:
iCell = iCell + 1
Loop
Any help would be much appreciated, I feel like I am going around in circles at the moment.