View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 6,953
Default Varaibles as both integer and String

set rng = Range("B9")
msgbox rng.Text


x = 1
msgbox Format(x,"#")

Hard to tell what you mean by a cell reference and an integer or use the
string of variable X. The above are some guesses.

--
Regards,
Tom Ogilvy


"RominallL" wrote:

Okay, all my VB is self taught so this might seem like a really stupid
question. I do a lot of variable declarations to use in my code and I need
to use those variables as cell references and also be able to use it as an
integer. Is there some expression that I can use to say use the string of
variable X?

I saw a reference somewhere about using something like what I want but it
was for OLAP stuff. I primarily use VB in excel/access.

Currently what I do is:
Dim X as integer
Dim XStr as string
x = 0
XStr = X

Seems really redundant.