ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Macro Help- Inserting Blank Rows (https://www.excelbanter.com/excel-discussion-misc-queries/126341-macro-help-inserting-blank-rows.html)

jack

Macro Help- Inserting Blank Rows
 
I have a spreadsheet that I've created a Macro to resort. In the
process of the resort, I had to get rid of blank rows between data. My
boss wants for the rows to be back in the report for aesthetic
reasons....how?!?

PreMacro:

9997468309 6600
9997291271
9997291298
9997484746

9997539753 8900
0030784328

9997539761 8910
0030416639

9997549023 5540
0030797683
0030922550
9997484746
9997549147

999754904X 4750


After My Macro:

9997550331 9450
0030421292
0030423430
0030423872
0030940354
003094127X
9997291271
9997291298
9997484746
9997559827 5070
0030780624
003078641X
003078672X
9997291271
9997291298
9997484746
9997551680 4070


thanks!


Don Guillett

Macro Help- Inserting Blank Rows
 
try this and tell your boss to send me a check.

Sub insertrowabove()
For i = Cells(Rows.Count, "c") _
..End(xlUp).Row To 2 Step -1
If Len(Cells(i, "c")) 2 Then Rows(i).Insert
Next i
End Sub


--
Don Guillett
SalesAid Software

"jack" wrote in message
ups.com...
I have a spreadsheet that I've created a Macro to resort. In the
process of the resort, I had to get rid of blank rows between data. My
boss wants for the rows to be back in the report for aesthetic
reasons....how?!?

PreMacro:

9997468309 6600
9997291271
9997291298
9997484746

9997539753 8900
0030784328

9997539761 8910
0030416639

9997549023 5540
0030797683
0030922550
9997484746
9997549147

999754904X 4750


After My Macro:

9997550331 9450
0030421292
0030423430
0030423872
0030940354
003094127X
9997291271
9997291298
9997484746
9997559827 5070
0030780624
003078641X
003078672X
9997291271
9997291298
9997484746
9997551680 4070


thanks!




jack

Macro Help- Inserting Blank Rows
 
Cheers! Thanks!


The check is in the mail!


Don Guillett wrote:
try this and tell your boss to send me a check.

Sub insertrowabove()
For i = Cells(Rows.Count, "c") _
.End(xlUp).Row To 2 Step -1
If Len(Cells(i, "c")) 2 Then Rows(i).Insert
Next i
End Sub


--
Don Guillett
SalesAid Software

"jack" wrote in message
ups.com...
I have a spreadsheet that I've created a Macro to resort. In the
process of the resort, I had to get rid of blank rows between data. My
boss wants for the rows to be back in the report for aesthetic
reasons....how?!?

PreMacro:

9997468309 6600
9997291271
9997291298
9997484746

9997539753 8900
0030784328

9997539761 8910
0030416639

9997549023 5540
0030797683
0030922550
9997484746
9997549147

999754904X 4750


After My Macro:

9997550331 9450
0030421292
0030423430
0030423872
0030940354
003094127X
9997291271
9997291298
9997484746
9997559827 5070
0030780624
003078641X
003078672X
9997291271
9997291298
9997484746
9997551680 4070


thanks!



Don Guillett

Macro Help- Inserting Blank Rows
 
Glad to help.

--
Don Guillett
SalesAid Software

"jack" wrote in message
ups.com...
Cheers! Thanks!


The check is in the mail!


Don Guillett wrote:
try this and tell your boss to send me a check.

Sub insertrowabove()
For i = Cells(Rows.Count, "c") _
.End(xlUp).Row To 2 Step -1
If Len(Cells(i, "c")) 2 Then Rows(i).Insert
Next i
End Sub


--
Don Guillett
SalesAid Software

"jack" wrote in message
ups.com...
I have a spreadsheet that I've created a Macro to resort. In the
process of the resort, I had to get rid of blank rows between data. My
boss wants for the rows to be back in the report for aesthetic
reasons....how?!?

PreMacro:

9997468309 6600
9997291271
9997291298
9997484746

9997539753 8900
0030784328

9997539761 8910
0030416639

9997549023 5540
0030797683
0030922550
9997484746
9997549147

999754904X 4750


After My Macro:

9997550331 9450
0030421292
0030423430
0030423872
0030940354
003094127X
9997291271
9997291298
9997484746
9997559827 5070
0030780624
003078641X
003078672X
9997291271
9997291298
9997484746
9997551680 4070


thanks!






All times are GMT +1. The time now is 10:09 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com