ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   CELL Function in VBA ? (https://www.excelbanter.com/excel-programming/377802-cell-function-vba.html)

Jakobshavn Isbrae

CELL Function in VBA ?
 
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.
--
jake

Don Guillett

CELL Function in VBA ?
 
Sub mypathis()
'MsgBox ActiveWorkbook.Path
'MsgBox ActiveWorkbook.Name
With ActiveWorkbook
MsgBox .Path & "\" & .Name
End With
End Sub


--
Don Guillett
SalesAid Software

"Jakobshavn Isbrae" wrote in
message ...
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.
--
jake




Doug Glancy

CELL Function in VBA ?
 
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" wrote in
message ...
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.
--
jake




Jakobshavn Isbrae

CELL Function in VBA ?
 
Don & Doug:

Thank you both very much.
--
jake


"Doug Glancy" wrote:

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" wrote in
message ...
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.
--
jake






All times are GMT +1. The time now is 01:48 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com