truebluewoman
New Member
- Joined
- Sep 26, 2014
- Messages
- 36
I am using Excel 2013 in Windows 7 Professional and need to do the following:
In Column GM, I have a property identification #.
In Column GI, I have a company identification #.
For every instance that the value 834 applears in column GM, I need a macro to enter the word "PROP 20" in the same row of Column GI. I have another group of similar items, but if I can figure the code for the one, I can repeat the same task for the other items.
I have been working on this for days and I am at my wit's end. I have been able to get ONE instance to happen, but I can't seem to get it to repeat until it runs through the entire list. I don't know a lot about VBA, but I've been able to construct a partial solution. Here is the code I have so far:
Sub Extract_Preparation()
'
' Macro that replaces PROP with PROP 20 and Yardi for properties 834,705, and 710 then
' sorts data by company, then by expense report #.
Dim colRange As Range
Dim cl As Range
Set colRange = Sheets("Extract Data").Range(Range("GM12"), Range("GM12").End(xlDown))
Set RngFound = Range("GM:GM").Find(What:=834, LookIn:=xlValues, _
LookAt:=xlWhole, _
MatchCase:=True)
For Each Found In colRange.Cells
RngFound.Offset(0, -4).Value = "PROP 20"
Next
Exit Sub
MsgBox "Extract Data Formatting Complete. You may now proceed to create the individual import files."
End Sub
Can anyone help me write the remaining code in order to repeat my function until it's complete? Thank you!
In Column GM, I have a property identification #.
In Column GI, I have a company identification #.
For every instance that the value 834 applears in column GM, I need a macro to enter the word "PROP 20" in the same row of Column GI. I have another group of similar items, but if I can figure the code for the one, I can repeat the same task for the other items.
I have been working on this for days and I am at my wit's end. I have been able to get ONE instance to happen, but I can't seem to get it to repeat until it runs through the entire list. I don't know a lot about VBA, but I've been able to construct a partial solution. Here is the code I have so far:
Sub Extract_Preparation()
'
' Macro that replaces PROP with PROP 20 and Yardi for properties 834,705, and 710 then
' sorts data by company, then by expense report #.
Dim colRange As Range
Dim cl As Range
Set colRange = Sheets("Extract Data").Range(Range("GM12"), Range("GM12").End(xlDown))
Set RngFound = Range("GM:GM").Find(What:=834, LookIn:=xlValues, _
LookAt:=xlWhole, _
MatchCase:=True)
For Each Found In colRange.Cells
RngFound.Offset(0, -4).Value = "PROP 20"
Next
Exit Sub
MsgBox "Extract Data Formatting Complete. You may now proceed to create the individual import files."
End Sub
Can anyone help me write the remaining code in order to repeat my function until it's complete? Thank you!