View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Susan Susan is offline
external usenet poster
 
Posts: 1,117
Default Using a Macro in Excel 2004 to move entered data from one sheetto another and space between rows when next data is entered?

i'll bite. :) SAVE your stuff before you try this in case it doesn't
do what you want.

========================
Sub bella()

Dim r As Long
Dim V As Variant
Dim x As Range
Dim myRange As Range
Dim ws As Worksheet
Dim LastRow As Long

Set ws = ActiveSheet
LastRow = ws.Cells(5000, 1).End(xlUp).Row
Set myRange = ws.Range("a1:a" & LastRow)

For r = myRange.Rows.Count To 1 Step -1
V = myRange.Cells(r, 1).Value
If V = " " Then
'do nothing
Else
Set x = myRange.Cells(r, 1)
x.EntireRow.Insert
End If
Next r

End Sub
========================
it's working on column A, so if that's not what you want, you'll have
to change references to column letters & numbers.
hope it helps!
susan




On Jun 4, 10:31*am, wrote:
I am trying to use a macro to do the following example:

Row 1 = data
Need to space
Row 3 = data
Need to space
Row 5 = data

Can anyone help???

Thanks,
Sandra M.
Texas