Hi, hopefully someone can help me with this issue.
I have a sheet setup basically like this:
Column A ... Column G
Plant1 $10
Plant9 $14
Plant1 $12
Plant12 $15
Plant5 $20
...
Plant10 $25
I want to loop down A14:A24 and check if any of the cells contain "Plant 1" through "Plant 7". If they contain any of those plants I then want it to
loop through G14:G24 and multiply the corresponding value in that row by 1.1
I have the following code so far:
It's working so far that it loops through both columns but instead of multiplying by 1.1 it seems to be multiplying by 2.85?Dim x1, x2 As Integer For x2 = 14 To 24 For x1 = 14 To 24 If Range("A" & Format(x1)).Value = "Plant1" Or _ Range("A" & Format(x1)).Value = "Plant 2" Or _ Range("A" & Format(x1)).Value = "Plant 3" Or _ Range("A" & Format(x1)).Value = "Plant 4" Or _ Range("A" & Format(x1)).Value = "Plant 5" Or _ Range("A" & Format(x1)).Value = "Plant 6" Or _ Range("A" & Format(x1)).Value = "Plant 7" Then Range("G" & Format(x1)).Value = Range("G" & Format(x1)).Value * 1.1 End If Next Next
Any idea what could be causing this? I'm always open to recommendations to simplify the code.
Thanks.
Bookmarks