LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 50
Default Insert rows in depending on criteria in variable columns

Sorry. Had it on my clipboard and everything. Here it is.

Sub InsertRows()
Dim cRows As Long
Dim i As Integer

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


" wrote:

hi,
first think to come to mind....
you can use inputbox to prompt for parameters.
in this case it might be column letter.
but since you didn't post any code, i have no idea where
to put it or how to use it.

-----Original Message-----
I would like to thank everyone in advance for looking

into this for me.

I currently have a macro that inserts a blank row after

every cell in column
A that changes. See below:

Tom
Tom
Tom
Dick
Dick
Harry
Harry
Harry

The macro would insert a row after the 3rd Tom, the 2nd

Dick, and the third
Harry. I have come across the need to be able to pick

which column I want the
macro to examine. Sometimes column A, sometimes AB, etc.

Any suggestions?

Thanks again

Jeff







.


 
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
Count/Sum rows of a column depending on criteria from drop-down li YY san.[_2_] Excel Worksheet Functions 4 December 22nd 09 01:43 AM
How do I add a variable range of columns depending on criteria Nedgingbelle Excel Worksheet Functions 0 November 25th 09 04:18 PM
Copying rows depending on criteria set? forevertrying Excel Discussion (Misc queries) 2 April 14th 08 03:00 PM
Insert rows depending on entry in certain column Gareth[_3_] Excel Programming 1 December 12th 03 03:24 AM
deleting the rows depending on the result of a condition involving two columns. pkseelam Excel Programming 2 August 26th 03 02:52 PM


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

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"