ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Using an excel built in function in a Macro (https://www.excelbanter.com/excel-programming/388369-using-excel-built-function-macro.html)

Yehuda[_2_]

Using an excel built in function in a Macro
 
This is problably a very basic question, How do I use an excel built in
functtion, such as CONCATENATE(), in my own macro?

Thank You

JMB

Using an excel built in function in a Macro
 
Either

Application.Worksheetfunction.Count(.....)
Application.Count(....)
Worksheetfunction.Count(....)

But I don't think Concatenate is available. You could just use &

"abc" & "123"



"Yehuda" wrote:

This is problably a very basic question, How do I use an excel built in
functtion, such as CONCATENATE(), in my own macro?

Thank You


Halim

Using an excel built in function in a Macro
 
Hi,

I've seen Concatenate in Excel builtin formula...
so you can use :
Application.Concatenate("abc"&"123")
to joining text with vba code

or use:
"abc" & "123"
like JMB wrote...

--

Regards,

Halim


"JMB" wrote:

Either

Application.Worksheetfunction.Count(.....)
Application.Count(....)
Worksheetfunction.Count(....)

But I don't think Concatenate is available. You could just use &

"abc" & "123"



"Yehuda" wrote:

This is problably a very basic question, How do I use an excel built in
functtion, such as CONCATENATE(), in my own macro?

Thank You


Ron Rosenfeld

Using an excel built in function in a Macro
 
On Sun, 29 Apr 2007 22:42:01 -0700, Halim
wrote:

I've seen Concatenate in Excel builtin formula...
so you can use :
Application.Concatenate("abc"&"123")
to joining text with vba code



Did you try this code?

It does not work in VBA with Excel 2003, on my machine, and, as JMB wrote,
CONCATENATE is not listed as a Worksheet Function available to Visual Basic.
--ron

Dave Peterson

Using an excel built in function in a Macro
 
For the equivalent of the worksheet function =concatenate(), you'd want to use
VBA's & operator.

But for other worksheet functions that can't be used in VBA (and don't have
equivalent functions in VBA), you could use something like:

Dim myStr As String
myStr = Application.Evaluate("Concatenate(""hi"", "" "", ""there"")")
MsgBox myStr

Again, don't use this kind of thing for =concatenate().

Yehuda wrote:

This is problably a very basic question, How do I use an excel built in
functtion, such as CONCATENATE(), in my own macro?

Thank You


--

Dave Peterson


All times are GMT +1. The time now is 05:37 PM.

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