Hi, I'm very new to VBA and have been learning through books and google for the last week. I've run into a problem with one of my projects, I'm hoping someone can help.
I'm trying to create a code that will look at the value (which will be "A","S", or "R") in a cell in the O column, and change the value in the corresponding B column to what is in the corresponding BD column.
For example, if O10 is A, nothing happens. If O10 is R or S, then B10 will show what is in BD10.
The data is only in Rows 10 - 77, the rest of the sheet has other information so that it can be printed and sent to our customer, so I really need the code to only run on Rows 10-77.
This is what I have, it keeps throwing a Type Mismatch error.
Thanks in advance for any help!
I'm trying to create a code that will look at the value (which will be "A","S", or "R") in a cell in the O column, and change the value in the corresponding B column to what is in the corresponding BD column.
For example, if O10 is A, nothing happens. If O10 is R or S, then B10 will show what is in BD10.
The data is only in Rows 10 - 77, the rest of the sheet has other information so that it can be printed and sent to our customer, so I really need the code to only run on Rows 10-77.
This is what I have, it keeps throwing a Type Mismatch error.
Code:
Private Sub ChangeToREJ()
Dim i As Integer
For i = 10 To 77
If Range("O" & i).Text = "R" Or "S" Then
Range("B" & 10).Text = Range("BD" & i).Text
End If
Next i
End Sub
Thanks in advance for any help!