Thread: a simple macro?
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Bryan Hessey
 
Posts: n/a
Default a simple macro?


Simply start from the end, asin:


Code:
--------------------
Sub testrow()
Dim LastRow As Integer, iCtr As Integer

LastRow = Range("a65536").End(xlUp).Row
MsgBox "last " & LastRow

For iCtr = LastRow To 2 Step -1
Range("A" & iCtr).EntireRow.Select
Selection.Insert Shift:=xlDown
Selection.Insert Shift:=xlDown
Next
End Sub
--------------------


Hope this helps

--

asalerno Wrote:
I have been trying to write what I thought was a simple macro with no
luck.

I have a column of text and I want to insert 2 blank lines between
every cell of text.

Example of what I have:

excel
excel
excel

What I want:

excel

excel

excel


I have been able to get the macro to insert 2 blank cells for however
many times I want, but I cannot get the macro to move down 3 rows
before it inserts the next 2 blank cells.

I have tried using xldirection and offset commands with no luck. This
is my first time playing with macros so it's quite possible I'm not
even using the above comands correctly. Anyone have an idea?



--
Bryan Hessey
------------------------------------------------------------------------
Bryan Hessey's Profile: http://www.excelforum.com/member.php...o&userid=21059
View this thread: http://www.excelforum.com/showthread...hreadid=537047