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"