Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Create formulas with $Rn1Cn2:$Rn1Cn3 format

I need to have VBA create formulas with mixed referencing such as:

=SUM($G10:$G20)

I can create =SUM($G$10:$G$20) and =SUM(G10:G20), neither of which is what I
need.

Thanks,
Mike.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Create formulas with $Rn1Cn2:$Rn1Cn3 format

Mike,

Have you tried something like

ActiveCell.FormulaR1C1 = "=SUM(R[10]C7:R[20]C7)"


--

HTH

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

"Michael D. Ober" <[email protected] wrote in message
...
I need to have VBA create formulas with mixed referencing such as:

=SUM($G10:$G20)

I can create =SUM($G$10:$G$20) and =SUM(G10:G20), neither of which is what

I
need.

Thanks,
Mike.




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,337
Default Create formulas with $Rn1Cn2:$Rn1Cn3 format

Sub makeformula()
[n5].Formula = "=SUM($G10:$G20)"
'[n5].Formula =[n5].value'to chg to value
End Sub


--
Don Guillett
SalesAid Software

"Michael D. Ober" <[email protected] wrote in message
...
I need to have VBA create formulas with mixed referencing such as:

=SUM($G10:$G20)

I can create =SUM($G$10:$G$20) and =SUM(G10:G20), neither of which is what

I
need.

Thanks,
Mike.




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Create formulas with $Rn1Cn2:$Rn1Cn3 format

sStr = "=SUM(G10:G20)"
? application.ConvertFormula(sStr,xlA1,xlA1,xlAbsRow RelColumn)
=SUM(G$10:G$20)
? application.ConvertFormula(sStr,xlA1,xlA1,xlRelRow AbsColumn)
=SUM($G10:$G20)

--
Regards,
Tom Ogilvy


Michael D. Ober <[email protected] wrote in message
...
I need to have VBA create formulas with mixed referencing such as:

=SUM($G10:$G20)

I can create =SUM($G$10:$G$20) and =SUM(G10:G20), neither of which is what

I
need.

Thanks,
Mike.




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
How do I create formulas between worksheets? JessicaLee0137 Excel Discussion (Misc queries) 6 February 24th 09 08:39 PM
CREATE AND IF FORMULAS fyrefox Excel Worksheet Functions 3 April 22nd 07 04:50 PM
How to create a conditional format that changes the number format tmbo Excel Discussion (Misc queries) 1 August 23rd 06 06:20 AM
create if formulas Lost in Excel Land Excel Worksheet Functions 1 June 30th 06 10:46 PM
create links for formulas weclean Excel Worksheet Functions 0 April 4th 05 10:09 PM


All times are GMT +1. The time now is 10:31 PM.

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"