LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Frantic Excel-er
 
Posts: n/a
Default Repeat statements "x" number of times...

Hi All,

I have the following code at the end of a long macro:

Columns("D:D").Find(What:="total").Select
ActiveCell.Offset(0, 4).Range("A1").Select
ActiveCell.FormulaR1C1 = "=Sum(RC[-1]-RC[-2])"
ActiveCell.NumberFormat = "0.00"
ActiveCell.Font.Bold = True
With ActiveCell.Interior
.ColorIndex = 6
End With

What I am doing is when the word "total" appears, it will go to the cell 4
columns to the right, and then do a formula and format the cell.

Question: How can I get this to repeat itself for each time the word
"total" appears. Each different time I run this macro, I may have anywhere
from 1 to 100 totals in the respective worksheet. I think that I need to
either loop, or do a for..next statement, but I don't know how to get the
syntax right, or which would work better.

Any help would be greatly appreciated...thanks in advance...

Sara
 
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
Number formatting Fred Holmes Excel Discussion (Misc queries) 2 February 21st 05 06:02 PM
How do I sort a column a unique number? ChelleA Excel Worksheet Functions 7 February 19th 05 10:38 AM
Countif("between start/end times) Ian Jones Excel Discussion (Misc queries) 0 January 6th 05 06:17 PM
Whats the function to count the total times a word is displayed Monk Excel Discussion (Misc queries) 3 December 10th 04 10:39 PM
Convert week number into calendar month? WickyWick Excel Worksheet Functions 2 November 9th 04 09:01 PM


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