PC Review


Reply
Thread Tools Rate Thread

Call a file name from within string

 
 
etradeguru@hotmail.com
Guest
Posts: n/a
 
      18th Sep 2007
Similar to my last post, I want to be able to change a parameter
within a calculation.

I have tried to modify code that I used for a similar event from
before but I am stumped.

The code is as follows: -

Dim extract As String
ActiveCell.FormulaR1C1 = _
extract = InputBox("Please enter Version Control Master file", "File
Name")
ActiveCell.FormulaR1C1 = _
"=+'[& extract &]Static Summary'!R9C3-'[Version Control Master
20070815.xls]Static Summary'R9C3"

Basically I am calling cell C9 from one sheet whose name changes daily
and subtracting the value in C9 on the other sheet which does not
change.

Responses/guidance gratefully received.
Thank you

Mark

 
Reply With Quote
 
 
 
 
JE McGimpsey
Guest
Posts: n/a
 
      18th Sep 2007
One way:

ActiveCell.FormulaR1C1 = _
"='[" & extract & "]Static Summary'!R9C3-'[Version Control Master
20070815.xls]Static Summary'R9C3"

In article <(E-Mail Removed)>,
(E-Mail Removed) wrote:

> ActiveCell.FormulaR1C1 = _
> "=+'[& extract &]Static Summary'!R9C3-'[Version Control Master
> 20070815.xls]Static Summary'R9C3"

 
Reply With Quote
 
etradeguru@hotmail.com
Guest
Posts: n/a
 
      18th Sep 2007
Je,
Tried your suggestion , comes up with a debug error.

I also tried this: -

ActiveCell.FormulaR1C1 = _
"='[" & extract & ".xls""]Static Summary'!R9C3-'[Version
Control Master 20070815.xls]Static Summary

but that just debugs too.

Mark


On 18 Sep, 13:18, JE McGimpsey <jemcgimp...@mvps.org> wrote:
> One way:
>
> ActiveCell.FormulaR1C1 = _
> "='[" & extract & "]Static Summary'!R9C3-'[Version Control Master
> 20070815.xls]Static Summary'R9C3"
>
> In article <1190115443.466122.208...@r29g2000hsg.googlegroups.com>,
>
>
>
> etradeg...@hotmail.com wrote:
> > ActiveCell.FormulaR1C1 = _
> > "=+'[& extract &]Static Summary'!R9C3-'[Version Control Master
> > 20070815.xls]Static Summary'R9C3"- Hide quoted text -

>
> - Show quoted text -



 
Reply With Quote
 
JE McGimpsey
Guest
Posts: n/a
 
      18th Sep 2007
Not sure what 'debug' error you're getting - I'd expect an application
error.

Just noticed that you left out the last exclamation point. Try:

ActiveCell.FormulaR1C1 = _
"='[" & extract & "]Static Summary'!R9C3-'[Version Control
Master 20070815.xls]Static Summary'!R9C3"


='[Workbook1.xls]Static Summary'!R9C3-'[Version Control Master
20070815.xls]Static Summary'!R9C3
In article <(E-Mail Removed)>,
(E-Mail Removed) wrote:

> Je,
> Tried your suggestion , comes up with a debug error.
>
> I also tried this: -
>
> ActiveCell.FormulaR1C1 = _
> "='[" & extract & ".xls""]Static Summary'!R9C3-'[Version
> Control Master 20070815.xls]Static Summary
>
> but that just debugs too.
>
> Mark
>
>
> On 18 Sep, 13:18, JE McGimpsey <jemcgimp...@mvps.org> wrote:
> > One way:
> >
> > ActiveCell.FormulaR1C1 = _
> > "='[" & extract & "]Static Summary'!R9C3-'[Version Control Master
> > 20070815.xls]Static Summary'R9C3"
> >
> > In article <1190115443.466122.208...@r29g2000hsg.googlegroups.com>,
> >
> >
> >
> > etradeg...@hotmail.com wrote:
> > > ActiveCell.FormulaR1C1 = _
> > > "=+'[& extract &]Static Summary'!R9C3-'[Version Control Master
> > > 20070815.xls]Static Summary'R9C3"- Hide quoted text -

> >
> > - Show quoted text -

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
call function from string var Pendragon Microsoft Access VBA Modules 2 28th Dec 2008 01:57 AM
Call UDF by String Name =?Utf-8?B?SG9raWV2YW5kYWw=?= Microsoft Excel Programming 2 25th May 2007 08:09 PM
sub call with string =?Utf-8?B?YXJhbg==?= Microsoft Excel Programming 5 18th Jun 2005 05:33 PM
String width API call Bob Berry Microsoft Windows 2000 Developer 1 7th Jan 2004 08:59 PM
can I call getString() to get a string from a separate resource file instead of embedded resource? babylon Microsoft Dot NET Framework 2 7th Oct 2003 04:13 PM


Features
 

Advertising
 

Newsgroups
 


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