LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 195
Default VBA to change mass formulas

I just went through a tedious exercise. I discovered some formulas whose
row references were off by two (may change). I had to manually navigate
through 100 of them over nearly 1900 rows and change them. I would like to
automate this if at some future time I make a similar discovery.

I will try to explain my data setup sufficiently to get a solution.

In ColB I have a formula every 19 rows (now) that sums values from 17 rows
(now) above it starting in row 4 in ColAB like this:
=SUM(AB4:AB20)
=SUM(AB23:AB39)
=SUM(AB42:AB58)
and so on every 19 rows (now) through (now) row 1902

The starting row will always be 4, but the number of total values to be
added (now 17) may change as I add or subtract classes from a list in ColA.
Each range in ColA starts with the student's name, followed by the current
class list (now 17) followed by 'Total Class Hours' for each of now 100
students. Cell in ColB to the right of 'Total Class Hours' adds the hours
from ColAB for each student. ColAB contains totals for each weekday for
each class attended by each student.

As I added or removed classes (I have macros to do this), I expected that
the SUM() formulas would adjust (and they usually did), but for some
unknown reason at some unknown time, they didn't. I don't want to have to
redo the formulas manually again if the same occurs.

I need something like:
For i = 1902 to 4 Step - 19
Range("B"&i).Row Formula = "SUM(AB&i-18:AB&i-1)"
Next i
I could figure out the relative numbers if they change.

or maybe some looping Offset from 'Total Class Hours' for each student

--
David
 
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
Mass Forumla Change Ghalmaraz Excel Worksheet Functions 1 March 19th 09 01:14 PM
How do I mass update formulas? karin Harpering Excel Discussion (Misc queries) 5 November 22nd 06 01:41 PM
Mass Change Hyperlinks Greg Terry Excel Programming 3 May 9th 05 03:51 PM
Mass Change Across Many WorkBOOKS SCSC Excel Discussion (Misc queries) 2 March 8th 05 11:43 PM
mass changes in formulas itsmetisa Excel Programming 5 December 19th 03 05:52 PM


All times are GMT +1. The time now is 08:48 AM.

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"