dorsey
10-09-2013, 07:30 PM
First off, thanks for taking the time to read this and respond if you do.
I am working on a task where I have multiple workbooks that are similar. Each workbook has column populated with state abbreviations. IA, IN, AL, AZ ..etc. I am trying to create a macro that will search cell in the column for IN, or IN , and if the cell has the string then add MI.
I have very rudimentary VB skills - basically I searched and found script that could find it using instr command. I can post this tomorrow night but I will try to give it my best shot here.
Sub - Code
Dim i
For i = 1 to 30
Instr(UseCase(Cells,i, "IN, ") then
ActiveCell = ActiveCell & ",MI"
End Step
End Sub
30 ,
Sorry as im sure this isnt exactly how it looks but its similar. right now it reads all 30 cells ad places 30 ,MI at the end of the string in A1 only. The column all be searching could be 1000 cells so the cell count For i statement may not be necessary. just the first thing I found that work.
Any help is appreciated.
I am working on a task where I have multiple workbooks that are similar. Each workbook has column populated with state abbreviations. IA, IN, AL, AZ ..etc. I am trying to create a macro that will search cell in the column for IN, or IN , and if the cell has the string then add MI.
I have very rudimentary VB skills - basically I searched and found script that could find it using instr command. I can post this tomorrow night but I will try to give it my best shot here.
Sub - Code
Dim i
For i = 1 to 30
Instr(UseCase(Cells,i, "IN, ") then
ActiveCell = ActiveCell & ",MI"
End Step
End Sub
30 ,
Sorry as im sure this isnt exactly how it looks but its similar. right now it reads all 30 cells ad places 30 ,MI at the end of the string in A1 only. The column all be searching could be 1000 cells so the cell count For i statement may not be necessary. just the first thing I found that work.
Any help is appreciated.