VB doesn't support what you are trying to do, at least not in the way you
are trying to do it. You should read up on arrays... they were placed in the
VB language strictly to be able to handle what you are attempting to do.
Basically, arrays are identically named variables that use an index value to
differentiate between the individual members of the array. This seems like a
reasonably decent introduction to arrays for you to study up on them...
http://patorjk.com/programming/tutorials/vbarrays.htm
If you Google "
vb arrays tutorial" (without the quote marks), you will get
other links as well.
--
Rick (MVP - Excel)
"salgud" wrote in message
...
I'm trying to create a formula to increment a counter. The variable name
contains a variable.
sCt = "A"
If rCell = "16" Then
sCt = rCell.Offset(, 2).Value
"l16" & sCt & "ct" = "l16 " & sCt & "ct" + 1
End If
It's turning red on me. I want it to yield
l16ACt = l16ACt + 1
That is "el sixteen Ay cee tee"
Does anyone know how to enter this?
Thanks!