CELL Function in VBA ?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

The formula
=CELL("filename",A1) gives me something like
C:\Documents and Settings\Owner\Desktop\[Book1.xls]Sheet1


in VBA
s = Application.WorksheetFunction.Cell("filename", A1)
does nothing. How can I get the same string in VBA that CELL() gives me in
the worksheet?

Thanks in advance for any help or suggestions.
 
Sub mypathis()
'MsgBox ActiveWorkbook.Path
'MsgBox ActiveWorkbook.Name
With ActiveWorkbook
MsgBox .Path & "\" & .Name
End With
End Sub
 
jake,

It doesn't look like Cell is a supported worksheet function.

Try using a combination of ActiveWorkbook.FullName and Activesheet.Name

hth,

Doug
 
Don & Doug:

Thank you both very much.
--
jake


Doug Glancy said:
jake,

It doesn't look like Cell is a supported worksheet function.

Try using a combination of ActiveWorkbook.FullName and Activesheet.Name

hth,

Doug

Jakobshavn Isbrae said:
The formula
=CELL("filename",A1) gives me something like
C:\Documents and Settings\Owner\Desktop\[Book1.xls]Sheet1


in VBA
s = Application.WorksheetFunction.Cell("filename", A1)
does nothing. How can I get the same string in VBA that CELL() gives me
in
the worksheet?

Thanks in advance for any help or suggestions.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top