Thread: variable
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
FSt1 FSt1 is offline
external usenet poster
 
Posts: 3,942
Default variable

hi,
try something like this.
Sub codeit()
Dim amt As Integer
Dim tcell As Range
Set tcell = Range("A1")
amt = tcell.Value
MsgBox amt
End Sub

regards
FSt1
"ranswert" wrote:

I can't seem to get a variable to get the value from a cell. I have set 'amt
as integer', 'tcell as range'. 'tcell' is formated as currency on the
spreadsheet. I am trying to get amt to equal the value in 'tcell', but it is
not working. I have tried:
amt = tcell,
amt = range(tcell) and
amt = range(tcell).value

none of those seem to work. What am I doing wrong?
Thanks