I3atnumb3rs
New Member
- Joined
- Nov 2, 2018
- Messages
- 34
Hello,
Trying to loop through the B column and when there's a certain string I want to enter a fixed value in column H, but when it's case REGULAR DELIVERY PV I also want to add the value of the j column to the fixed value. I know I need to do an offset but my code doesn't seem to work. Please help
Sub PriceChange()
Dim x As Long
For x = 2 To Cells(Rows.Count, "B").End(xlUp).Row
Select Case UCase(Cells(x, 2))
Case "FLY BY"
Cells(x, 8).FormulaR1C1 = 25
Case "MERGE"
Cells(x, 8).FormulaR1C1 = 25
Case "CANCELLED"
Cells(x, 8).FormulaR1C1 = 15
Case "REGULAR DELIVERY PV"
Cells(x, 8).FormulaR1C1 = 250 + ActiveCell.Offset(0, -2)
End Select
Next x
End Sub
Trying to loop through the B column and when there's a certain string I want to enter a fixed value in column H, but when it's case REGULAR DELIVERY PV I also want to add the value of the j column to the fixed value. I know I need to do an offset but my code doesn't seem to work. Please help
Sub PriceChange()
Dim x As Long
For x = 2 To Cells(Rows.Count, "B").End(xlUp).Row
Select Case UCase(Cells(x, 2))
Case "FLY BY"
Cells(x, 8).FormulaR1C1 = 25
Case "MERGE"
Cells(x, 8).FormulaR1C1 = 25
Case "CANCELLED"
Cells(x, 8).FormulaR1C1 = 15
Case "REGULAR DELIVERY PV"
Cells(x, 8).FormulaR1C1 = 250 + ActiveCell.Offset(0, -2)
End Select
Next x
End Sub