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

Hi Gang,

What is the VBA statement or sequence needed to insert a blank row in
between changes in a particular column? Say I have a column that has
the alphanumeric sequence of abc123. It then repeats 5 times downward
in the same column. Then the sequence changes to def456. How do I
insert a blank row in between the changes in sequence?

Thank you as always.


Sam

  #2   Report Post  
Posted to microsoft.public.excel.programming
Sam Sam is offline
external usenet poster
 
Posts: 19
Default Insert blank row macro question.


Sam wrote:
Hi Gang,

What is the VBA statement or sequence needed to insert a blank row in
between changes in a particular column? Say I have a column that has
the alphanumeric sequence of abc123. It then repeats 5 times downward
in the same column. Then the sequence changes to def456. How do I
insert a blank row in between the changes in sequence?

Thank you as always.


Sam

================================================== ====
My apologies I found Don Guillett had answered this question already.

Thank you though.

2 From: Don Guillett - view profile
Date: Fri, Feb 3 2006 9:00 am
Email: "Don Guillett"
Groups: microsoft.public.excel.misc
Not yet ratedRating:
show options
Reply | Reply to Author | Forward | Print | Individual Message | Show
original | Report Abuse | Find messages by this author


try this. the key is working from the bottom up instead of the top
down.


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


--
Don Guillett
SalesAid Software

"rtidrtid"
wrote in
message ...



- Hide quoted text -
- Show quoted text -

anyone a dab hand at Excel? I need a had creating a macro. What i have
is a column with numbers, for example



12222
12222
21111
21111
13333
13333



what i need is a macro which will insert a blank row after an identical
sequence of numbers, turning the above into



12222
12222



21111
21111



13333
13333



any ideas?



--
rtidrtid
------------------------------------------------------------------------
rtidrtid's Profile:
http://www.excelforum.com/member.php...o&userid=31148
View this thread: http://www.excelforum.com/showthread...hreadid=508130




Reply Rate this post:

  #3   Report Post  
Posted to microsoft.public.excel.programming
Sam Sam is offline
external usenet poster
 
Posts: 19
Default Insert blank row macro question.(adding color)

I feel silly adding to my own post but:

How do I color the blank ranges that were inserted as a result of
running the insert rows macro? I could figure out the color I would
want to use. Can you ladies n gents point me in the right direction
please? I am using this to open up a spreadsheet and break out the rows
based on completed inventory transactions.

Thanks guys.

Sam

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
Macro to insert copy and insert formulas only to next blank row bob Excel Programming 0 June 30th 06 12:02 PM
Insert blank line macro laidebug Excel Worksheet Functions 1 April 14th 06 11:56 PM
Macro code to test for blank row and insert blank row if false Mattie Excel Programming 2 March 29th 06 01:19 AM
Macro To Insert Blank Row? rtidrtid Excel Discussion (Misc queries) 1 February 3rd 06 03:00 PM
Macro to insert blank lines Terry Pinnell Excel Discussion (Misc queries) 6 October 21st 05 11:21 PM


All times are GMT +1. The time now is 02:44 AM.

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

About Us

"It's about Microsoft Excel"