View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Don Guillett Don Guillett is offline
external usenet poster
 
Posts: 10,124
Default Fundamental problem with Indirect function

why not
x=range("c2")
or
x=cells(2,3)
x=cells(2,"c")

--
Don Guillett
SalesAid Software

"JohnM" wrote in message
ups.com...
This is my first post.

I don't seem to have the indirect function included in my library of
objects. The following code gets me an error "Object doesn't support
this porperty or method".

Sub Hithere()
x = WorksheetFunction.INDIRECT(C2)
MsgBox x
End Sub

If I change the second line to x = INDIRECT(C2), I get "Compiler error:
Sub or Function not defined."

I can't find INDIRECT anywhere in the Excel Visual Basic help. And it
is not listed among the "List of Worksheet Functions Available to
Visual Basic" in my Visual Basic Help(though I can use it fine within
Excel by itself). But this seems to be a commonly used function as
judged by my perusal of the messages in this group. Am I doing
something wrong? Is something wrong with my excel or Visual Basic?
Please help.

I'm using Excel 2003 and with Microsoft Visual Basic 6.3.

Thank you,
JohnM