Patriot2879
Well-known Member
- Joined
- Feb 1, 2018
- Messages
- 1,227
- Office Version
- 2010
- Platform
- Windows
Hello i have the code below which works great where if there is a blacnk cell it copies the data to the left. but i want to add another column J and if there is an empty cell to input zero into the cell, please can you help?
VBA Code:
Dim rBlanks As Range
Set copySheet = Worksheets("New")
Set pasteSheet = Worksheets("Combined")
Set rBlanks = Nothing
With ThisWorkbook.Sheets("New")
On Error Resume Next
Set rBlanks = Intersect(.Range("R:R"), .UsedRange).SpecialCells(xlCellTypeBlanks)
On Error GoTo 0
If Not rBlanks Is Nothing Then
rBlanks.FormulaR1C1 = "=RC[-1]"
Intersect(.Range("R:R"), .UsedRange).Copy
.Range("R1").PasteSpecial (xlPasteValues)
Application.CutCopyMode = False
End If
End With
Last edited: