#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Formulas


How do I create a Macro that creates a formula in a cell instead of just
inputting a value?

Suppose I want to add two cells:

1.) C:\Documents and
Settings\pgalla06\Desktop\Company\[Wolf.xls]Other Coverages'!$G$7

and

2.) Y4

So that the formula in the cell reads:

=C:\Documents and Settings\pgalla06\Desktop\Company\[Wolf.xls]Other
Coverages'!$G$7+Y4

I only know how to create macro that inputs a value in the cell not a
formula. Any help is greatly appreciated.

Thanks,
PEter


--
PGalla06
------------------------------------------------------------------------
PGalla06's Profile: http://www.excelforum.com/member.php...o&userid=24260
View this thread: http://www.excelforum.com/showthread...hreadid=379509

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Formulas


Just put quotes around your formula as you would put it directly into
worksheet cell.

Range("A1") = "=C:\Documents an
Settings\pgalla06\Desktop\Company\[Wolf.xls]Other Coverages'!$G$7+Y4"

Substitute the destination cell for A1 in the range assignment

HT

--
bhofset
-----------------------------------------------------------------------
bhofsetz's Profile: http://www.excelforum.com/member.php...fo&userid=1880
View this thread: http://www.excelforum.com/showthread.php?threadid=37950

Reply
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
Convert Array Formulas to Regular Formulas Domenick Excel Worksheet Functions 6 August 17th 15 09:16 PM
Convert Array Formulas to Regular Formulas minyeh Excel Worksheet Functions 0 March 21st 10 05:55 AM
E2007 formulas display as formulas, not results Pierre Excel Worksheet Functions 3 January 14th 10 04:59 PM
Counting # of Formulas in a column with formulas and entered data Brand Excel Worksheet Functions 1 October 10th 09 01:01 PM
CELLS NOT CALC FORMULAS - VALUES STAY SME FORMULAS CORRECT?? HELP Sherberg Excel Worksheet Functions 4 September 11th 07 01:34 AM


All times are GMT +1. The time now is 02:34 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"