Hi
How to define a formula through vb code into excel range?
//Thomas
Hi
How to define a formula through vb code into excel range?
//Thomas
Range("B10").Formula = "=Sum($B$1:$B$9)"
--
Regards,
Tom Ogilvy
"Jonsson" <[email protected]> wrote in
message news:[email protected]...
>
> Hi
>
> How to define a formula through vb code into excel range?
>
> //Thomas
>
>
> --
> Jonsson
> ------------------------------------------------------------------------
> Jonsson's Profile:
http://www.excelforum.com/member.php...fo&userid=5472
> View this thread: http://www.excelforum.com/showthread...hreadid=468654
>
Hi Thomas,
Look at the 'FormulaR1C1 Property' and 'Formula Property' in VBA help and
see also the examples provided,
---
Regards,
Norman
"Jonsson" <[email protected]> wrote in
message news:[email protected]...
>
> Hi
>
> How to define a formula through vb code into excel range?
>
> //Thomas
>
>
> --
> Jonsson
> ------------------------------------------------------------------------
> Jonsson's Profile:
> http://www.excelforum.com/member.php...fo&userid=5472
> View this thread: http://www.excelforum.com/showthread...hreadid=468654
>
Make up the range statement and then store it in the Excel Names Store.
You put it in with
ActiveWorkbook.Names("Name").Delete
ActiveWorkbook.Names.Add Name:="Name", RefersToR1C1:=String
where "Name" is the way you will reference it later.
You can get it back with
Temp = ActiveWorkbook.Names("Name").Value
with a little tinkering to get off the "=" the quotes.
Good luck,
Mac Lingo
Thanks, IŽll try that
//Thomas
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks