I am a bit of a novice with VBA and would appreciate some help please.
I am trying to write a
macro to populate column B with a formula based on the value in column C, then loop through until last row. I've modified
some code I found but can't get it to work properly. Basically, if the letter "P" appears in a cell in column C a formula is
to be placed in column B of the same row, but if the letter "F" appears then an alternative formula is to be entered. Also,
if the cell in column C is blank then the code should skip to the next row without altering that row. Hope this makes
Sample code follows and test file is attached.
Dim x As Integer
For x = 3 To Cells(Rows.Count, "A").End(xlUp).Row
Select Case Cells(x, 3)
Case Is = P
Cells(x, 2) = "=RC[-1]*100"
Case Is = F
Cells(x, 2) = "=RC[-1]*1000"
Cells(x, 2) = "="""""
If you like these VB formatting tags please consider sponsoring the author in support of injured Royal Marines
Thanks for any help.