Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 913
Default Insert Blank Row at a Position Based on Value?

On Sun, 30 Aug 2009 09:30:34 -0700 (PDT),
"
wrote:

Hi,

I'm tring to automate a whole load of steps with macro's, but have got
stuck with this one :-

I have a large worksheet sorted by column A, which is number of
transactions. I need to insert a blank row at the point where the
number of transactions is above 499. Easy to do manually, but I can't
figure how to do this in a macro. This is a repetive process where the
original data varies daily, so this position won't always be at the
same row. Any ideas ?


Try this macro:

Sub insert_row_after_499()
r = 1
With ActiveSheet
While .Cells(r, "A") < "" And .Cells(r, "A") <= 499
r = r + 1
Wend
.Cells(r, "A").EntireRow.Insert
End With
End Sub

Hope this helps / Lars-Åke
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: Insert Blank Row with formulas uses absolute position probl steveb Excel Discussion (Misc queries) 1 June 18th 09 08:08 PM
Auto insert a blank row above the current row based on a cell val. mattwill Excel Discussion (Misc queries) 2 November 6th 08 11:30 PM
Insert, position, and resize a picture w/ Macro John Excel Discussion (Misc queries) 1 July 10th 07 07:21 PM
How insert a dash in the third position of a column with data? warren Excel Discussion (Misc queries) 1 July 19th 06 09:42 PM
Lookup with search range start based on position of last blank lin rcmodelr Excel Worksheet Functions 0 November 14th 04 06:32 AM


All times are GMT +1. The time now is 12:56 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"