Hi all -
As the title reads, if column C contains certain text, then populate column G with specific text. Additionally, move the newly created text in column G up 1 cell. I'm getting the code to populate column G, however, i'm having trouble with the offset portion of the code.
Here is what I have so far:
Sub info()
Dim i As Long
For i = 1 To ActiveSheet.Cells(Rows.Count, 1).End(xlUp).Row
If ActiveSheet.Cells(i, 3) = "Bank Account" Then
ActiveSheet.Range("G" & i) = "'Result"
End If
Next i
End Sub
Sub tested()
Dim rng As Range
Dim lrow As Integer
With ActiveSheet
lrow = .Range("G" & Rows.Count).End(xlUp).Row
For Each rng In .Range("G:G" & lrow)
If InStr(rng.Value, "'Result") > 0 Then
rng.Offset(1, 0).Value = rng.Value
rng.Value = ""
End If
Next rng
End With
End Sub
As the title reads, if column C contains certain text, then populate column G with specific text. Additionally, move the newly created text in column G up 1 cell. I'm getting the code to populate column G, however, i'm having trouble with the offset portion of the code.
Here is what I have so far:
Sub info()
Dim i As Long
For i = 1 To ActiveSheet.Cells(Rows.Count, 1).End(xlUp).Row
If ActiveSheet.Cells(i, 3) = "Bank Account" Then
ActiveSheet.Range("G" & i) = "'Result"
End If
Next i
End Sub
Sub tested()
Dim rng As Range
Dim lrow As Integer
With ActiveSheet
lrow = .Range("G" & Rows.Count).End(xlUp).Row
For Each rng In .Range("G:G" & lrow)
If InStr(rng.Value, "'Result") > 0 Then
rng.Offset(1, 0).Value = rng.Value
rng.Value = ""
End If
Next rng
End With
End Sub