View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default Sub to change formulas in a col

Can't you just change one, then copy down?

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Max" wrote in message
...
Hi guys,

I need help for a sub which can change existing formulas in col D
which refers to a particular sheetname, to an equivalent which
uses INDIRECT() reading the same sheetname now placed in D3 instead

For example:

Need to change existing: =SUM('1'!G33:M33)-'1'!L33

to

:=SUM(INDIRECT("'"&D$3&"'"&"!G33:M33"))-INDIRECT("'"&D$3&"'!L33")

The sheetname: "1" (without the double quotes) is entered into D3

There's quite a fair bit of cells involved in col D
which carries similar formulas to be changed,
so automating the formula change would be very useful.

(And once the entire col's formulas have been changed,
I could just simply fill col D across another 30 or so columns.
The sheetnames: "1", "2", "3", etc represent the days of the month)

Thanks for insights
--
Rgds
Max
xl 97
---
Please respond in thread
xdemechanik <atyahoo<dotcom
----