Syntax question

jboles

New Member
Joined
Aug 13, 2003
Messages
44
Anyone know the syntax for accessing all formulas in a sheet. I have a sheet full of look up formulas that relies on a data range within a spearate file. That separate file is always named by date. I want access all the formulas and swap the existing date with a new date. I willl more than likely add a control of some sort that captures the the date the user wants and then assign the input to a variable swap in plae of the current date variable.

No problem on the swap routine...just need to know how to access the formulas.

Thanks
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
Select all your cells then click on Edit-Goto-Special, and choose the Formulas option and click OK.
 
Upvote 0
I don't quite understand..are you suggesting that I record a macro to see the code? With my cells selected after using GoTo it simply selects the first cell in the range that has a formula. I need to run a VBA routine that will accept a date value from the the user via something like an Input Box and assign it to a variable so I can swap with the variable I have already assigned to represent the current date after accessing all my formulas. There must be something like:

Cells.Range.Formulas...for example
 
Upvote 0
Yes. If had recorded the macro you would have got some code which you could amend and assign to a Range variable, eg-

Code:
Sub GetAllFormulas()
Dim rngFormulas As Range

Set rngFormulas = Cells.SpecialCells(xlCellTypeFormulas, 23)
rngFormulas.Select 'Do your stuff here, no need to Select

End Sub

Just work with the rngFormulas variable as you would do with a normal Range object.
 
Upvote 0
SUBSTITUTE(text,old_text,new_text,instance_num)

Text is the text or the reference to a cell containing text for which you want to substitute characters.

Old_text is the text you want to replace.

New_text is the text you want to replace old_text with.

Instance_num specifies which occurrence of old_text you want to replace with new_text. If you specify instance_num, only that instance of old_text is replaced. Otherwise, every occurrence of old_text in text is changed to new_text.

If you can refer to your dates as text, this could save you from having to write a macro.
 
Upvote 0

Forum statistics

Threads
1,203,052
Messages
6,053,223
Members
444,648
Latest member
sinkuan85

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top