can we add a blank line after every...lines?

B

Bob Phillips

Martyn,

Here is some code

Dim i As Long
Dim cRows As Long

cRows = Cells(Rows.Count, "A").End(xlUp).Row
cRows = cRows - (cRows Mod 20)

For i = cRows To 20 Step -20
Cells(i, "A").EntireRow.Insert
Next i

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
M

Martyn

Hi,
Wanna add a blank line to the worksheet after every 20 lines with a macro.
Can you suggest ways?
TIA
 
M

Martyn

Thanks a lot Bob,
it does the trick.


Bob Phillips said:
Martyn,

Here is some code

Dim i As Long
Dim cRows As Long

cRows = Cells(Rows.Count, "A").End(xlUp).Row
cRows = cRows - (cRows Mod 20)

For i = cRows To 20 Step -20
Cells(i, "A").EntireRow.Insert
Next i

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 

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

Top