VBAmature31
New Member
Hi all,
I have a report I am trying to filter and have come across a problem I am not able to solve!
Basically I am trying to find any cell that contains a font that in bold in column "D" and if found to copy that cell and also the cell to the right of it at the end of the worksheet,Please see my code below.
I have it working to the extent that it copies the bold cells but cannot get it to also copy the cell to the right.
Any help would be greatly appreciated.
Sub test()
Dim i As Long, LR As Long
LR = Range("d" & Rows.Count).End(xlUp).Row
For i = 1 To LR
If Range("d" & i).Font.Bold = True Then
Range("d" & i).Copy Destination:=Range("d" & Range("d" & Rows.Count).End(xlUp).Offset(1, 0).Row)
End If
Next i
End Sub
Thanks
KD
I have a report I am trying to filter and have come across a problem I am not able to solve!
Basically I am trying to find any cell that contains a font that in bold in column "D" and if found to copy that cell and also the cell to the right of it at the end of the worksheet,Please see my code below.
I have it working to the extent that it copies the bold cells but cannot get it to also copy the cell to the right.
Any help would be greatly appreciated.
Sub test()
Dim i As Long, LR As Long
LR = Range("d" & Rows.Count).End(xlUp).Row
For i = 1 To LR
If Range("d" & i).Font.Bold = True Then
Range("d" & i).Copy Destination:=Range("d" & Range("d" & Rows.Count).End(xlUp).Offset(1, 0).Row)
End If
Next i
End Sub
Thanks
KD