Excel - Copy named range, but skip blanks

Asked By Munchkin on 14-Dec-09 12:52 PM
My goal here is to copy "NewRecord" and paste values only in the first blank
cell in column A on the Payment History sheet, while skipping blanks rows.

rows will have data entered, sometimes only the 1st row.

The marco works, but does not skip the blank rows in NewRecord - is it
because there are formulas present?  How do I fix this?

Also, how do I assure my macro is pasting on the first blank row of column
A?


Application.Goto Reference:="NewRecord"
Selection.Copy
Sheets("Payment History").Select
Range("A1").Select
Selection.End(xlDown).Select
Range("A292").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
End Sub




joel replied to Munchkin on 14-Dec-09 01:34 PM
LastRow = Sheets("Payment History").Range("A" &
Rows.Count).End(xlUp).Row
NewRow = LastRow + 1

NumberofRows = Range("NewRecord").Rows.Count

For RowCount = 1 To NumberofRows
If Range("NewRecord").Offset(RowCount - 1, 0) _
Resize(1, 1).Value <> "" Then

Range("NewRecord").Rows(RowCount).Copy
Sheets("Payment History").Range("A" & NewRow).PasteSpecial _
Paste:=xlPasteValues
NewRow = NewRow + 1
End If

Next RowCount


--
joel
------------------------------------------------------------------------
joel's Profile: 229
View this thread: http://www.thecodecage.com/forumz/showthread.php?t=162385

[url="http://www.thecodecage.com"]Microsoft Office Help[/url]