Using a Macro in Excel 2004 to move entered data from one sheet toanother and space between rows whe

  • Thread starter Thread starter bella.sandi
  • Start date Start date
B

bella.sandi

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
 
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
 

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