Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Named Ranges


I am trying to use VB to enter TREND functions into my worksheet. This
works OK if I use code similar to the following,

ActiveSheet.Range(Cells(7, 9), Cells(7, 13)).Select
Selection.FormulaArray = _

"=TREND(R[-4]C[-7]:R[-4]C[-1],R[-6]C[-7]:R[-6]C[-1],R[-6]C:R[-6]C[4])"

or
Range("L26:P26").Select
Selection.FormulaArray =
"=TREND(TestRange1,Testrange2,TestRange3)"


but I want to be able to change the ranges as required.
Q1.. Can I use variables in these lines or
Q2.. Can I create Named Ranges using variables.

Thanks in anticipation


--
Guitar Billy
------------------------------------------------------------------------
Guitar Billy's Profile: http://www.excelforum.com/member.php...o&userid=37859
View this thread: http://www.excelforum.com/showthread...hreadid=574104

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Named Ranges

sFormula = "=TREND(" & sAddr1 & "," & sAddr2 & "," & sAddr3 & ")"

ActiveSheet.Range(Cells(7, 9), Cells(7, 13)).FormulaArray = sFormula

Regards,
Peter T

"Guitar Billy"
wrote in message
news:Guitar.Billy.2cxr9q_1156240506.1618@excelforu m-nospam.com...

I am trying to use VB to enter TREND functions into my worksheet. This
works OK if I use code similar to the following,

ActiveSheet.Range(Cells(7, 9), Cells(7, 13)).Select
Selection.FormulaArray = _

"=TREND(R[-4]C[-7]:R[-4]C[-1],R[-6]C[-7]:R[-6]C[-1],R[-6]C:R[-6]C[4])"

or
Range("L26:P26").Select
Selection.FormulaArray =
"=TREND(TestRange1,Testrange2,TestRange3)"


but I want to be able to change the ranges as required.
Q1.. Can I use variables in these lines or
Q2.. Can I create Named Ranges using variables.

Thanks in anticipation


--
Guitar Billy
------------------------------------------------------------------------
Guitar Billy's Profile:

http://www.excelforum.com/member.php...o&userid=37859
View this thread: http://www.excelforum.com/showthread...hreadid=574104



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


Just the job! Works a treat.
Thank you.


--
Guitar Billy
------------------------------------------------------------------------
Guitar Billy's Profile: http://www.excelforum.com/member.php...o&userid=37859
View this thread: http://www.excelforum.com/showthread...hreadid=574104

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
Copy data in named ranges to a newer version of the same template to identical ranges handstand Excel Programming 0 August 21st 06 03:51 PM
named ranges UsGrant_75 Excel Worksheet Functions 2 June 23rd 06 01:38 AM
Named Ranges robhargreaves[_6_] Excel Programming 1 July 26th 05 08:14 PM
Like 123, allow named ranges, and print named ranges WP Excel Discussion (Misc queries) 1 April 8th 05 06:07 PM
named ranges - changing ranges with month selected gr8guy Excel Programming 2 May 28th 04 04:50 AM


All times are GMT +1. The time now is 03:35 AM.

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"