Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
 
Posts: n/a
Default use of variable in formula / execute4excel

Hi,

I am trying to do an execute4excel which should read as follows:

execute4excel "formula(""=R5C3"")"

the problem is is that the "5" in the R5C3 bit is going to change, as
it is a variable. I've set up the following string to contain the whole
formula:

****
' set up the formula string
Dim formulaString As String
formulaString = "formula(""""=R"
formulaString = formulaString & rowNumber
formulaString = formulaString & "c3"""")"
****

and now want to do something along the lines of:

ExecuteExcel4Macro " formulaString "
, but this hangs...


In terms of the big picture, I'm trying to make a shape on a worksheet,
and insert into it the text contained in the row 5 column 3; then
create another shape with the text from row 6 column 3 etc... and this
appears to be a way of doing it... if there's a better one I'd love to
hear about it!

Any help would be very greatfully received :D

Cheers

Chris

  #2   Report Post  
Posted to microsoft.public.excel.misc
Chip Pearson
 
Posts: n/a
Default use of variable in formula / execute4excel

Change
ExecuteExcel4Macro " formulaString "
to
ExecuteExcel4Macro formulaString


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



wrote in message
ups.com...
Hi,

I am trying to do an execute4excel which should read as
follows:

execute4excel "formula(""=R5C3"")"

the problem is is that the "5" in the R5C3 bit is going to
change, as
it is a variable. I've set up the following string to contain
the whole
formula:

****
' set up the formula string
Dim formulaString As String
formulaString = "formula(""""=R"
formulaString = formulaString & rowNumber
formulaString = formulaString & "c3"""")"
****

and now want to do something along the lines of:

ExecuteExcel4Macro " formulaString "
, but this hangs...


In terms of the big picture, I'm trying to make a shape on a
worksheet,
and insert into it the text contained in the row 5 column 3;
then
create another shape with the text from row 6 column 3 etc...
and this
appears to be a way of doing it... if there's a better one I'd
love to
hear about it!

Any help would be very greatfully received :D

Cheers

Chris



  #3   Report Post  
Posted to microsoft.public.excel.misc
 
Posts: n/a
Default use of variable in formula / execute4excel

Cheers Chip - tried that but it still hangs in the debugger with a
runtime error 1004....

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
Using a variable in a VBA formula Colin Vicary Excel Discussion (Misc queries) 3 November 8th 05 11:39 AM
use a variable array in a formula JPderose Excel Discussion (Misc queries) 1 October 20th 05 06:24 AM
Refrencing a variable cell in a formula C Brehm Excel Discussion (Misc queries) 2 October 10th 05 03:30 PM
Variable Sheet Name in Formula Barb R. Excel Discussion (Misc queries) 5 July 6th 05 06:20 PM
Formula checking multiple worksheets sonic-the-mouse Excel Worksheet Functions 2 June 5th 05 03:28 AM


All times are GMT +1. The time now is 07:44 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"