Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Using a Macro in Excel 2004 to move entered data from one sheet toanother and space between rows when next data is entered?

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
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


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Print only rows with data entered in an excel template hellaby Excel Discussion (Misc queries) 1 August 9th 08 04:16 PM
Macro to record date on sheet data is entered in a cell ? Jim scrivener Excel Programming 2 August 24th 06 05:56 PM
Can I rearrange data entered in rows into colums in Excel? Robin Excel Discussion (Misc queries) 1 January 30th 06 07:48 PM
excel spread sheet wont caculate new data entered in ranges. Art-needs-help Excel Discussion (Misc queries) 3 November 8th 05 02:06 PM
I entered 11/22/2004 in excel workbook and it keeps changing to ## Firefly Excel Worksheet Functions 1 February 24th 05 06:11 PM


All times are GMT +1. The time now is 12:44 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"