Stephen Byrom
asked on
refer to variable named workbook
Related to a previous question,.
How can I refer to a variable named workbook.
Set wb2 = ThisWorkbook.FullName Replace("Performance", "Scoreboard", , , vbTextCompare)
doesn't work
and I have tried a few combinations.
Sorry if I am a pain.
How can I refer to a variable named workbook.
Set wb2 = ThisWorkbook.FullName Replace("Performance", "Scoreboard", , , vbTextCompare)
doesn't work
and I have tried a few combinations.
Sorry if I am a pain.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Hello,
the syntax for the replace function is
Replace(expression, find, replace[, start[, count[, compare]]])
In your previous question (which would have been a lot easier to find if you had posted a related question or included a link to the previous question), this line of code was suggested:
application.workbooks.open replace(thisworkbook.FullN ame, "Performance", "Scoreboard",,,vbTextCompa re)
Your current line of code is missing an element:
>> Set wb2 = ThisWorkbook.FullName Replace("Performance", "Scoreboard", , , vbTextCompare)
You do not state the "expression" bit, but seem to supply the "find", "replace" and "compare" bits only.
I'm not quite sure what you want to achieve, but maybe
Set wb2 = Replace(ThisWorkbook.FullN ame, "Performance", "Scoreboard", , , vbTextCompare)
<not tested!>
If that does not help, please post your code in full and explain the context of what you are trying to achieve.
cheers, teylyn
the syntax for the replace function is
Replace(expression, find, replace[, start[, count[, compare]]])
In your previous question (which would have been a lot easier to find if you had posted a related question or included a link to the previous question), this line of code was suggested:
application.workbooks.open
Your current line of code is missing an element:
>> Set wb2 = ThisWorkbook.FullName Replace("Performance", "Scoreboard", , , vbTextCompare)
You do not state the "expression" bit, but seem to supply the "find", "replace" and "compare" bits only.
I'm not quite sure what you want to achieve, but maybe
Set wb2 = Replace(ThisWorkbook.FullN
<not tested!>
If that does not help, please post your code in full and explain the context of what you are trying to achieve.
cheers, teylyn
ASKER
Thanks again for the help.
The assistance I get on here also helps me understand more the syntax etc.
Thanks again.
To Teylyn,
I am sorry for not being more helpfull with the links in my original post. I will remember to do that in future.
The assistance I get on here also helps me understand more the syntax etc.
Thanks again.
To Teylyn,
I am sorry for not being more helpfull with the links in my original post. I will remember to do that in future.
FYI, when a question is 'related' you have the option from that closed question to "sk a related question" via the button ... this includes a hyperlink to the original question in your new one and then would perhaps serve to provide the clarification Teylyn suggested. This is always good because the more relevant info you post the more likely you are to get multiple experts responding and that has to be a good thing for you as the asker.
Chris
Chris
ASKER
Thanks for the tip Chris.
I will remember that in future.
(there will be more questions, there always are)
:)
I will remember that in future.
(there will be more questions, there always are)
:)
>> (there will be more questions, there always are)
:)
What would life be without challenges?
Glad you found your answer from an expert who knows the subject.
:)
What would life be without challenges?
Glad you found your answer from an expert who knows the subject.
Set wb2 = application.workbooks.open