Macro to find blank cell

  • Thread starter Thread starter Cutter
  • Start date Start date
C

Cutter

Hi

I'm hoping to get some help in writing a macro to do the following:

Copy data that is in active cell on active sheet
Go to first empty cell in range D9:D729 of Sheet2
Paste the value only
Drop down one row
Insert one row
End

Any help is greatly appreciated.
Thank
 
Hi Cutter

Sub test()
Dim r As Range, rr As Range
Set rr = ActiveCell
With Sheets("Sheet2")
If Application.CountA(.Range("D2:D729")) = 728 Then
MsgBox "No empty cells"
Else
Set r = _
..Range("D2:D729").SpecialCells(xlCellTypeBlanks).Cells(1)
r.Formula = rr.Value2
r.Offset(1, 0).EntireRow.Insert Shift:=xlDown
End If
End With
End Sub


--
XL2002
Regards

William

(e-mail address removed)

| Hi
|
| I'm hoping to get some help in writing a macro to do the following:
|
| Copy data that is in active cell on active sheet
| Go to first empty cell in range D9:D729 of Sheet2
| Paste the value only
| Drop down one row
| Insert one row
| End
|
| Any help is greatly appreciated.
| Thanks
|
|
| ---
| Message posted
|
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top