I3atnumb3rs
New Member
- Joined
- Nov 2, 2018
- Messages
- 34
Hi,
I'm trying to loop through each row in column c to look for a string, if that string is there I want it to enter a certain price in column H, otherwise I want to leave the data currently in column H untouched. My code sort of works but seems to delete the data in H during the loop. Please help!
Sub PostalPricingSpecial()
Dim x As Long
Application.ScreenUpdating = False
For x = 2 To Cells(Rows.Count, "C").End(xlUp).Row
Select Case UCase(Cells(x, 3))
Case "K0A 3M0"
Cells(x, 8).FormulaR1C1 = "195"
Case "K0B 1K0"
Cells(x, 8).FormulaR1C1 = "195"
Case Else
Cells(x, 8).Formula = "="""""
End Select
Next x
End Sub
I'm trying to loop through each row in column c to look for a string, if that string is there I want it to enter a certain price in column H, otherwise I want to leave the data currently in column H untouched. My code sort of works but seems to delete the data in H during the loop. Please help!
Sub PostalPricingSpecial()
Dim x As Long
Application.ScreenUpdating = False
For x = 2 To Cells(Rows.Count, "C").End(xlUp).Row
Select Case UCase(Cells(x, 3))
Case "K0A 3M0"
Cells(x, 8).FormulaR1C1 = "195"
Case "K0B 1K0"
Cells(x, 8).FormulaR1C1 = "195"
Case Else
Cells(x, 8).Formula = "="""""
End Select
Next x
End Sub