ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Using VBA Functions in a worksheet (https://www.excelbanter.com/excel-programming/339265-using-vba-functions-worksheet.html)

Gary''s Student

Using VBA Functions in a worksheet
 
Within VBA I can access worksheet functions, like ROMAN, as follows:

TryString = Application.WorksheetFunction.Roman(i)

In the worksheet I can access worksheet functions and any UDFs I define.

How can I access VBA functions, like DIR(), in the worksheet?

--
Gary''s Student

Don Guillett[_4_]

Using VBA Functions in a worksheet
 
Maybe with a worksheet_event macro. Right click the sheet tabview codeleft
window worksheetright window for different events

--
Don Guillett
SalesAid Software

"Gary''s Student" wrote in message
...
Within VBA I can access worksheet functions, like ROMAN, as follows:

TryString = Application.WorksheetFunction.Roman(i)

In the worksheet I can access worksheet functions and any UDFs I define.

How can I access VBA functions, like DIR(), in the worksheet?

--
Gary''s Student




Gary''s Student

Using VBA Functions in a worksheet
 
This is similar to what I am attempting to avoid. For example IsDate() is
available in VBA, but is not a worksheet function. To use IsDate() in the
worksheet, I create a UDF as follows:

Function isdt(s As Range) As Boolean
isdt = IsDate(s)
End Function

I can then use isdt (a.k.a IsDate) anywhere in the worksheet.

Do I have to create a UDF for every VBA function I want to use in the
worksheet??
--
Gary''s Student


"Don Guillett" wrote:

Maybe with a worksheet_event macro. Right click the sheet tabview codeleft
window worksheetright window for different events

--
Don Guillett
SalesAid Software

"Gary''s Student" wrote in message
...
Within VBA I can access worksheet functions, like ROMAN, as follows:

TryString = Application.WorksheetFunction.Roman(i)

In the worksheet I can access worksheet functions and any UDFs I define.

How can I access VBA functions, like DIR(), in the worksheet?

--
Gary''s Student





Don Guillett[_4_]

Using VBA Functions in a worksheet
 
A udf works like any other function in that it can only return values. With
that in mind, I guess so.

--
Don Guillett
SalesAid Software

"Gary''s Student" wrote in message
...
This is similar to what I am attempting to avoid. For example IsDate() is
available in VBA, but is not a worksheet function. To use IsDate() in the
worksheet, I create a UDF as follows:

Function isdt(s As Range) As Boolean
isdt = IsDate(s)
End Function

I can then use isdt (a.k.a IsDate) anywhere in the worksheet.

Do I have to create a UDF for every VBA function I want to use in the
worksheet??
--
Gary''s Student


"Don Guillett" wrote:

Maybe with a worksheet_event macro. Right click the sheet tabview

codeleft
window worksheetright window for different events

--
Don Guillett
SalesAid Software

"Gary''s Student" wrote in

message
...
Within VBA I can access worksheet functions, like ROMAN, as follows:

TryString = Application.WorksheetFunction.Roman(i)

In the worksheet I can access worksheet functions and any UDFs I

define.

How can I access VBA functions, like DIR(), in the worksheet?

--
Gary''s Student







Gary''s Student

Using VBA Functions in a worksheet
 
Thank you
--
Gary''s Student


"Don Guillett" wrote:

A udf works like any other function in that it can only return values. With
that in mind, I guess so.

--
Don Guillett
SalesAid Software

"Gary''s Student" wrote in message
...
This is similar to what I am attempting to avoid. For example IsDate() is
available in VBA, but is not a worksheet function. To use IsDate() in the
worksheet, I create a UDF as follows:

Function isdt(s As Range) As Boolean
isdt = IsDate(s)
End Function

I can then use isdt (a.k.a IsDate) anywhere in the worksheet.

Do I have to create a UDF for every VBA function I want to use in the
worksheet??
--
Gary''s Student


"Don Guillett" wrote:

Maybe with a worksheet_event macro. Right click the sheet tabview

codeleft
window worksheetright window for different events

--
Don Guillett
SalesAid Software

"Gary''s Student" wrote in

message
...
Within VBA I can access worksheet functions, like ROMAN, as follows:

TryString = Application.WorksheetFunction.Roman(i)

In the worksheet I can access worksheet functions and any UDFs I

define.

How can I access VBA functions, like DIR(), in the worksheet?

--
Gary''s Student








All times are GMT +1. The time now is 04:40 AM.

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