Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Transporting Variable from macro to spreadsheet

I have calculated a variable 'n' in a macro and want to put it into a
spreadsheet.
The expression ActiveCell.Formula = "= Max(R3Cn:R3C256)" doesn't work,
although substituting a number for n does work
Any solutions would be appreciated
--
Ken
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Transporting Variable from macro to spreadsheet

Ken,

Try something like
ActiveCell.Formula = "= Max(R3C" & N & ":R3C256)"


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
(email address is on the web site)

"Ken Newman" wrote in message
...
I have calculated a variable 'n' in a macro and want to put it into a
spreadsheet.
The expression ActiveCell.Formula = "= Max(R3Cn:R3C256)" doesn't work,
although substituting a number for n does work
Any solutions would be appreciated
--
Ken



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Transporting Variable from macro to spreadsheet

Although Chip's line of code may work, I bet he meant:

ActiveCell.FormulaR1C1 = "= Max(R3C" & N & ":R3C256)"


Chip Pearson wrote:

Ken,

Try something like
ActiveCell.Formula = "= Max(R3C" & N & ":R3C256)"

--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
(email address is on the web site)

"Ken Newman" wrote in message
...
I have calculated a variable 'n' in a macro and want to put it into a
spreadsheet.
The expression ActiveCell.Formula = "= Max(R3Cn:R3C256)" doesn't work,
although substituting a number for n does work
Any solutions would be appreciated
--
Ken


--

Dave Peterson
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
Variable data from one spreadsheet sent to new spreadsheet vasi via OfficeKB.com New Users to Excel 0 October 20th 08 07:08 PM
Running a variable macro when any value is entered into a variable cell [email protected] Excel Programming 3 December 14th 05 06:15 PM
Looking up blank cells and transporting data to another worksheet Hari[_3_] Excel Programming 2 August 31st 04 02:33 PM
Use row number in spreadsheet as variable in macro captbluefin Excel Programming 1 October 10th 03 03:49 PM
Transporting a toolbar within a spreadsheet Kent Spry Excel Programming 1 August 13th 03 11:03 AM


All times are GMT +1. The time now is 12:41 AM.

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"