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

I have the following two problems:

1. I want to substitute the string "A_030716_cl_max_val_EK" with
variable (filestringL) that contains this string. How can I do tha
(see statement following)?

ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatab ase, SourceData:
"A_030716_cl_max_val_EK!R1C1:R74C11").CreatePivotT abl
TableDestination:="", _
TableName:="PivotTable2"
DefaultVersion:=xlPivotTableVersion10

2. I want to substitute in the following statement the 9000 with a
integer that contains the value. Any ideas?

ActiveCell.FormulaR1C1 = _
"=VLOOKUP(Members,
Code
-------------------
s Sheet1'!R2C1:R9000C7,5,0)"

Thank you in advance.
G

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default substitute strings with variables

banavas,

You need to concatinate the variables with the strings
with the "&" character. Like:

Dim MyString as String

Mystring = "A_030716_cl_max_val_EK"

ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatab ase,_
SourceData:=
Mystring & "!R1C1:R74C11").CreatePivotTable _
TableDestination:="", _
TableName:="PivotTable2", _
DefaultVersion:=xlPivotTableVersion10

Dim MyRow as Integer

MyRow = 9000

ActiveCell.FormulaR1C1 = _
"=VLOOKUP(Members,' _
Code: _
--------------------
s Sheet1'!R2C1:R" & MyRow & "C7,5,0)"


-----Original Message-----
I have the following two problems:

1. I want to substitute the

string "A_030716_cl_max_val_EK" with a
variable (filestringL) that contains this string. How

can I do that
(see statement following)?

ActiveWorkbook.PivotCaches.Add(SourceType:=xlData base,

SourceData:=
"A_030716_cl_max_val_EK!R1C1:R74C11").CreatePivot Table
TableDestination:="", _
TableName:="PivotTable2",
DefaultVersion:=xlPivotTableVersion10

2. I want to substitute in the following statement the

9000 with an
integer that contains the value. Any ideas?

ActiveCell.FormulaR1C1 = _
"=VLOOKUP(Members,'
Code:
--------------------
s Sheet1'!R2C1:R9000C7,5,0)"

Thank you in advance.
G.


---
Message posted from http://www.ExcelForum.com/

.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default substitute strings with variables

Dim i as long, sStr as String

sStr = "A_030716_cl_max_val_EK"
ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatab ase, SourceData:=
sStr & "!R1C1:R74C11").CreatePivotTable
TableDestination:="", _
TableName:="PivotTable2",
DefaultVersion:=xlPivotTableVersion10

i = 9000

ActiveCell.FormulaR1C1 = _
"=VLOOKUP(Members,'s Sheet1'!R2C1:R" & i & "C7,5,0)"

--
Regards,
Tom Ogilvy


"banavas " wrote in message
...
I have the following two problems:

1. I want to substitute the string "A_030716_cl_max_val_EK" with a
variable (filestringL) that contains this string. How can I do that
(see statement following)?

ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatab ase, SourceData:=
"A_030716_cl_max_val_EK!R1C1:R74C11").CreatePivotT able
TableDestination:="", _
TableName:="PivotTable2",
DefaultVersion:=xlPivotTableVersion10

2. I want to substitute in the following statement the 9000 with an
integer that contains the value. Any ideas?

ActiveCell.FormulaR1C1 = _
"=VLOOKUP(Members,'
Code:
--------------------
s Sheet1'!R2C1:R9000C7,5,0)"

Thank you in advance.
G.


---
Message posted from http://www.ExcelForum.com/



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
SUBSTITUTE multiple text strings richzip Excel Discussion (Misc queries) 8 April 22nd 23 12:10 PM
find and replace numeric strings in larger text strings Mr Molio Excel Worksheet Functions 8 November 9th 11 05:17 PM
=SUBSTITUTE(SUBSTITUTE(SUBSTITUTE.... max. limit 8 :( [email protected] Excel Discussion (Misc queries) 6 May 22nd 08 05:33 PM
Complex Text Strings|Variables cogent Excel Programming 4 April 8th 04 02:45 AM
Converting strings to Sum worksheet function and control variables Spammastergrand Excel Programming 5 February 21st 04 05:12 PM


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