Home |
Search |
Today's Posts |
#1
![]() |
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Number formatting | Excel Discussion (Misc queries) | |||
How do I sort a column a unique number? | Excel Worksheet Functions | |||
Countif("between start/end times) | Excel Discussion (Misc queries) | |||
Whats the function to count the total times a word is displayed | Excel Discussion (Misc queries) | |||
Convert week number into calendar month? | Excel Worksheet Functions |