I wonder if anybody can help me a bit here, what I am trying to achieve is as follows
Search down column (“F5 : F”) until it finds a blank cell in column (“I5 : I”)
When it finds a blank cell I need to do this
Offset from the active cell in column (“F”) to the blank cell in column (“I”)
Format the font in the blank cell in column (“I “) to Red and also adjacent cell in column (“J”)
I then need to copy the value in (F) where the code has stopped and paste it at the end of column (B5 : B), then offset (0,2) from there and enter a zero.
Repeat above until all blank cells in column (F5 : F) have been found
This all sounds really simple when you write it down, normally I can sort of get things going to a point, but I am really struggling on this one.
There is probably so much wrong with this code but I cannot even get passed this line
I get the error “Run time Error object required”
Any help is as always very much appreciated
Code (if you can call it that) below
Search down column (“F5 : F”) until it finds a blank cell in column (“I5 : I”)
When it finds a blank cell I need to do this
Offset from the active cell in column (“F”) to the blank cell in column (“I”)
Format the font in the blank cell in column (“I “) to Red and also adjacent cell in column (“J”)
I then need to copy the value in (F) where the code has stopped and paste it at the end of column (B5 : B), then offset (0,2) from there and enter a zero.
Repeat above until all blank cells in column (F5 : F) have been found
This all sounds really simple when you write it down, normally I can sort of get things going to a point, but I am really struggling on this one.
There is probably so much wrong with this code but I cannot even get passed this line
VBA Code:
If rw.Columns ("I") = "" Then
Any help is as always very much appreciated
Code (if you can call it that) below
VBA Code:
Sub AddUsedStockCodes()
NumRows = Range("F5", Range("F5").End(xlDown)).Rows.Count ' Set numrows = number of rows of data.
Range("F5").Select ' Select cell to start.
For x = 1 To NumRows ' Establish "For" loop to loop "numrows" number of times.
If rw.Columns("I") = "" Then
ActiveCell.Offset(0, 3).Select
With Selection.Font
.ThemeColor = vbRed
ActiveCell.Offset(0, 1).Select
With Selection.Font
.ThemeColor = vbRed
ActiveCell.Offset(0, -4).Select
ActiveCell.Copy
Range("B5").Select
Selection.End(xlDown).Offset(1, 0).Select
ActiveCell.PasteSpecial xlPasteValues
ActiveCell.Offset(0, 3).Select
ActiveCell.Value = 0
End With
End With
End If
Next
End Sub