If cell in column C contains the value GBP, change cell S from that row from 13 to 23
or
If a cell column C contains the value USD change cell S from that row from 13 to 33
exception cell: C1 --> contains the title of the column
OP, what is "contains"? C2 could be just (example) "GBP" or "Price in GBP".
The InStr function finds the starting position of a string within another, if it's there. So if the cell is "GBP" then InStr("GBPUSD", Cell) returns 1. If the cell is "USD" InStr("GBPUSD", Cell) returns 4.
Thus:
Sub test()
For Each Cell In Range("C2:C" & Range("C" & Rows.Count).End(xlUp).Row)
Select Case InStr("GBPUSD", Cell)
Case 1
Range("S" & Cell.Row) = 23
Case 4
Range("S" & Cell.Row) = 33
End Select
Next Cell
End Sub
Status
Not open for further replies.
You have insufficient privileges to reply here.
Related Threads
?
?
?
?
?
Tech Support Guy
9.9M posts
859.7K members
Since 1998
A forum community dedicated to tech experts and enthusiasts. Come join the discussion about articles, computer security, Mac, Microsoft, Linux, hardware, networking, gaming, reviews, accessories, and more!