View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Peter T Peter T is offline
external usenet poster
 
Posts: 5,600
Default Check to see if cell is blank

One way,

Sub test()
Dim rCopy As Range, rDest As Range

Set rCopy = ActiveSheet.Range("A1:D1")
Set rDest = ActiveSheet.Range("A24")

If Len(rDest) Then
If Len(rDest.Offset(1, 0)) Then
Set rDest = rDest.End(xlDown).Offset(1, 0)
Else
Set rDest = rDest.Offset(1, 0)
End If
End If

rCopy.Copy rDest

End Sub

Note no need to select

Regards,
Peter T

"Munchkin" wrote in message
...
I want my macro to first check & see if A9 is blank. If it is I want to
paste copied data in A9, if it is not blank I want to proceed with finding
the 1st blank cell in column A and pasting there (which is how the macro
is
set up)


Range("A9").Select
Selection.End(xlDown).Select
ActiveCell.Offset(rowOffset:=1).Activate

ActiveSheet.Paste
Columns("D:D").EntireColumn.AutoFit