question about creating variable from 2 strings

  • Thread starter Thread starter Gary Keramidas
  • Start date Start date
G

Gary Keramidas

may have asked this before, but can't find it.
is it possible to create a variable from 2 strings and have it return the value?
Simple example, RowColor is Dimmed as Long and has as value of 4
2 strings, one String1 is "Row" the other, String2 is "Color"
join the 2 strings to make "RowColor"

range("A1").interior.colorindex = String1 & String2
 
went a different route and used select case instead.

--


Gary


"Gary Keramidas" <GKeramidasATmsn.com> wrote in message may have asked this before, but can't find it.
is it possible to create a variable from 2 strings and have it return the value?
Simple example, RowColor is Dimmed as Long and has as value of 4
2 strings, one String1 is "Row" the other, String2 is "Color"
join the 2 strings to make "RowColor"

range("A1").interior.colorindex = String1 & String2
 
How about putting the values in a collection?

Sub test()
Dim col As New Collection
Dim String1 As String, string2 As String

col.Add 4, "RowColor"
col.Add 12, "RowHeight"

String1 = "Row"
string2 = "Color"

MsgBox col(String1 & string2)

End Sub
 
Back
Top