bluepenink
Well-known Member
- Joined
- Dec 21, 2010
- Messages
- 585
hi guys....can someone assist with the following macro
essentially, i want the macro to copy/paste where there is a value > 0 or <>"" in column Y from the "data" tab.
the current macro is copy/pasting everything ...thx you in advance!
essentially, i want the macro to copy/paste where there is a value > 0 or <>"" in column Y from the "data" tab.
the current macro is copy/pasting everything ...thx you in advance!
Code:
Sub _Merge()
Dim rngCopy As Range, LR As Long
With Sheets("OUT")
'Clear old data
If .Range("A8") <> Empty Then .Range("A8", .Range("A" & Rows.Count).End(xlUp)).EntireRow.ClearContents
'Copy
With Sheets("Data")
LR = .Range("B" & Rows.Count).End(xlUp).Row
Set rngCopy = .Range("A7:AH" & LR)
End With
.Range("B8").Resize(rngCopy.Rows.Count, 2).Value = rngCopy.Columns("J:K").Value
.Range("D8").Resize(rngCopy.Rows.Count, 1).Value = rngCopy.Columns("D").Value
.Range("E8").Resize(rngCopy.Rows.Count, 1).Value = rngCopy.Columns("F").Value
.Range("F8").Resize(rngCopy.Rows.Count, 1).Value = rngCopy.Columns("N").Value
.Range("K8").Resize(rngCopy.Rows.Count, 2).Value = rngCopy.Columns("O:P").Value
.Range("N8").Resize(rngCopy.Rows.Count, 1).Value = rngCopy.Columns("O").Value
.Range("O8").Resize(rngCopy.Rows.Count, 1).Value = rngCopy.Columns("Y").Value
.Range("P8").Resize(rngCopy.Rows.Count, 1).Value = rngCopy.Columns("Y").Value
.Range("A8").Resize(rngCopy.Rows.Count).Value = "ABC Inc."
End With
End Sub