Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Print only rows with data entered in an excel template | Excel Discussion (Misc queries) | |||
Macro to record date on sheet data is entered in a cell ? | Excel Programming | |||
Can I rearrange data entered in rows into colums in Excel? | Excel Discussion (Misc queries) | |||
excel spread sheet wont caculate new data entered in ranges. | Excel Discussion (Misc queries) | |||
I entered 11/22/2004 in excel workbook and it keeps changing to ## | Excel Worksheet Functions |