Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
microsoft.public.vb.general.discussion
inserting blank rows
chris smith
8/18/2010 4:04:00 AM
my worksheet has info in every row. I would like to insert a blank row
between each without doing it manually. Can someone help?
1 Answer
GS
8/18/2010 4:49:00 AM
0
chris smith wrote on 8/18/2010 :
> my worksheet has info in every row. I would like to insert a blank row
> between each without doing it manually. Can someone help?
This greoup is for VB6 and earlier. This sounds like a question for the
Excel programming group. If you're automating Excel from a VB.exe then
provide more info.
Otherwise, start from the last row and work up to the first row you
want to insert a blank row before. Make sure you get a row count before
you begin so you can ref each existing non-blank row.
<air code>
For r = RowCount To FirstRow Step - 1
Cells(r).EntireRow.Insert Shift:=xlDown
Next r
So if there's 20 rows to begin with, the first blank row will be
inserted at row20; existing (row20) shifts down to row21 and the
inserted row is now row20. The next insert position is row19 and so the
process repeats all the way up to Row(FirstRow).
HTH
--
Garry
Free usenet access at
http://www.eternal-sep...
ClassicVB Users Regroup! comp.lang.basic.visual.misc
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
inserting blank rows
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password