Hi,

I have written a simple copy&paste macro.

I was wondering if anyone had any suggestions for how to check if there is no data on the row before pasting? (Seeing as there is no undo)

I guess I need and If IsEmpty type function and Else then give an error.


Sub Update_Month()

' Update the fills for the specific day

Dim number As Integer
Dim row_number As Integer

'enter number in day box at B8, then this will paste to the correct place on sheet

row_number = Sheets("Data").Range("B8").Value + 3

'I need an if statement for here I think that looks at the row entered (row_number) and checks that it is empty or zero from column 2 to 500

Sheets("Data").Select
Range("A5:HD5").Select
Selection.Copy
Sheets("Current").Select
Cells(row_number, 2).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False

'Else an error message

End Sub


Could anyone help me on this? Particularly in using my row_number to look across a range.

Thanks