LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Debi
 
Posts: n/a
Default Insert Row with a macro

When I use the following code in an Excel macro to insert a row, it does not
work correctly. Instead of inserting just one row above the TOTAL EXPENSES
row, rows will continue to be inserted until the worksheet runs out of rows.
Could someone please help me.

For Each c In [A1:A150]
If c Like "TOTAL EXPENSES" Then
c.Activate
ActiveCell.EntireRow.Insert
End If
Next

I have to use the "TOTAL EXPENSES" instead of the row number because this is
a report I import from another program and the row number that TOTAL EXPENSES
appears in varies from report to report depending on how many expenses are in
each report.
Thanks
 
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
Insert date in macro George Gee New Users to Excel 12 April 17th 06 05:44 AM
Insert Line Macro Spyder Excel Discussion (Misc queries) 1 March 3rd 05 12:17 AM
How do I insert the date using a macro tara0801 Excel Discussion (Misc queries) 4 February 10th 05 09:09 PM
How to insert a Macro within a macro? Thrava Excel Discussion (Misc queries) 3 February 8th 05 01:10 AM
Challenging Charting C TO Charts and Charting in Excel 0 January 17th 05 06:57 PM


All times are GMT +1. The time now is 04:20 PM.

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"