Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default blank rows macro question


This works beautifully Trevor, I forgot to mention something though. I
have a header on row 3, and hide row 1 and 2. So.... I would like to
have the blank rows start at row 4 blank then part numbers then blank
row then part numbers. This code puts a blank row above my header on
row 3. How do I get it to start at row 4?

Trevor Shuttleworth Wrote:
DKY

one way:

Sub test()
Dim LastRow As Long
Dim i As Long
LastRow = Range("B65536").End(xlUp).Row
Application.ScreenUpdating = False
For i = LastRow To 2 Step -1
If Range("B" & i).Value < _
Range("B" & i - 1).Value Then
Range("B" & i).EntireRow.Insert
End If
Next 'i
Application.ScreenUpdating = True
End Sub

Regards

Trevor


"DKY" wrote in message
...

I get this spreadsheet every week that I have to format and all, so

I
recorded a macro. Something I have to do manually is go through all
the part numbers in columb B and find similar ones. I sort them by
column B, then I insert a blank row to seperate groups of part

numbers.
Is there anyway to throw this in my macro? Have it sort by column b
then put a space after every seperate set of part numbers?


--
DKY

------------------------------------------------------------------------
DKY's Profile:

http://www.excelforum.com/member.php...o&userid=14515
View this thread:

http://www.excelforum.com/showthread...hreadid=262505



--
DKY
------------------------------------------------------------------------
DKY's Profile: http://www.excelforum.com/member.php...o&userid=14515
View this thread: http://www.excelforum.com/showthread...hreadid=262505

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,089
Default blank rows macro question

DKY

For i = LastRow To 4 Step -1

Regards

Trevor


"DKY" wrote in message
...

This works beautifully Trevor, I forgot to mention something though. I
have a header on row 3, and hide row 1 and 2. So.... I would like to
have the blank rows start at row 4 blank then part numbers then blank
row then part numbers. This code puts a blank row above my header on
row 3. How do I get it to start at row 4?

Trevor Shuttleworth Wrote:
DKY

one way:

Sub test()
Dim LastRow As Long
Dim i As Long
LastRow = Range("B65536").End(xlUp).Row
Application.ScreenUpdating = False
For i = LastRow To 2 Step -1
If Range("B" & i).Value < _
Range("B" & i - 1).Value Then
Range("B" & i).EntireRow.Insert
End If
Next 'i
Application.ScreenUpdating = True
End Sub

Regards

Trevor


"DKY" wrote in message
...

I get this spreadsheet every week that I have to format and all, so

I
recorded a macro. Something I have to do manually is go through all
the part numbers in columb B and find similar ones. I sort them by
column B, then I insert a blank row to seperate groups of part

numbers.
Is there anyway to throw this in my macro? Have it sort by column b
then put a space after every seperate set of part numbers?


--
DKY

------------------------------------------------------------------------
DKY's Profile:

http://www.excelforum.com/member.php...o&userid=14515
View this thread:

http://www.excelforum.com/showthread...hreadid=262505



--
DKY
------------------------------------------------------------------------
DKY's Profile:

http://www.excelforum.com/member.php...o&userid=14515
View this thread: http://www.excelforum.com/showthread...hreadid=262505



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Hiding blank rows using a macro GJR3599 Excel Discussion (Misc queries) 1 March 20th 07 09:22 PM
Macro Help- Inserting Blank Rows jack Excel Discussion (Misc queries) 3 January 16th 07 09:43 PM
Delete blank rows Macro Richard Excel Discussion (Misc queries) 3 November 4th 05 08:02 AM
blank rows macro question DKY[_7_] Excel Programming 2 September 22nd 04 07:32 PM
macro to delete entire rows when column A is blank ...a quick macro vikram Excel Programming 4 May 3rd 04 08:45 PM


All times are GMT +1. The time now is 12:28 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"