Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / October 2006

Tip: Looking for answers? Try searching our database.

how to create a variable based in others

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
mtorres.f@gmail.com - 05 Oct 2006 12:37 GMT
Hi every one,

basically I need to solve this problem:

Dim c as String
Dim n as String
Dim Cojonudo as String

Public sub fff
c="Cojo"
n="nudo"

c & n = "whatever"

end sub

But this doesn´t work, any idea how can I create the variable based in
the other two.

Thanks
Dave Lett - 05 Oct 2006 12:50 GMT
Are you trying to get this:

Dim c as String
Dim n as String
Dim Cojonudo as String

Public sub fff
c="Cojo"
n="nudo"

Cojonudo  = c & n

HTH,
Dave

Hi every one,

basically I need to solve this problem:

Dim c as String
Dim n as String
Dim Cojonudo as String

Public sub fff
c="Cojo"
n="nudo"

c & n = "whatever"

end sub

But this doesn´t work, any idea how can I create the variable based in
the other two.

Thanks
Greg Maxey - 05 Oct 2006 12:55 GMT
I don't think I understand exactly what you are trying to do:

Public Sub fff()
Dim c As String
Dim n As String
Dim Cojonudo As String
c = "Cojo"
n = "nudo"
Cojonudo = c & n
MsgBox Cojonudo
End Sub

> Hi every one,
>
[quoted text clipped - 16 lines]
>
> Thanks
Helmut Weber - 05 Oct 2006 16:38 GMT
Hi Greg, hi Dave,

I think the OP wants to declare a variable
at runtime, the name of which is unknown
at the programs start and should be the result
of a concatenation of the names of two other variables.

@OP: No way,
except crazy workarounds like having
a macro modify itself, like in virus programming.
I think I saw some code of that kind once.
And hardly a need to go for it.

Signature

Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.