Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Steve Haack
 
Posts: n/a
Default How do I use Excel Built-In Functions in Code?

I would like to be able to call some of the excel built-in functions
(specfically VLOOKUP) in some code. Can someone point me to an example of how
to do this?

Thanks,
Steve
  #3   Report Post  
Steve Haack
 
Posts: n/a
Default

Don,
Thanks for the quick response. I tried that and not help came up. I've
noticed that I don't get the interactive help before on things. Is there a
way to turn that on and off (perhaps I inadvertantly turned it off and didn't
know it). Also, does it matter where the code is being put? I am trying to
put it on a worksheet object using a Change event.

Thanks again,
Steve

"Don Guillett" wrote:

in the vbetype vlookup and touch the enter key. HELP will appear

--
Don Guillett
SalesAid Software

"Steve Haack" wrote in message
...
I would like to be able to call some of the excel built-in functions
(specfically VLOOKUP) in some code. Can someone point me to an example of

how
to do this?

Thanks,
Steve




  #4   Report Post  
JulieD
 
Posts: n/a
Default

Hi Steve

there's a problem with VBA Help and looking up functions directly.

In the "ask a question box" type "worksheet functions" and you'll see a help
entry on "Using Microsoft Excel Worksheet Functions in Visual Basic" if you
click on there it will give you details and also provide another link to
"List of Worksheet Functions Available to Visual Basic".

--
Cheers
JulieD
check out www.hcts.net.au/tipsandtricks.htm
....well i'm working on it anyway
"Steve Haack" wrote in message
...
Don,
Thanks for the quick response. I tried that and not help came up. I've
noticed that I don't get the interactive help before on things. Is there a
way to turn that on and off (perhaps I inadvertantly turned it off and
didn't
know it). Also, does it matter where the code is being put? I am trying to
put it on a worksheet object using a Change event.

Thanks again,
Steve

"Don Guillett" wrote:

in the vbetype vlookup and touch the enter key. HELP will appear

--
Don Guillett
SalesAid Software

"Steve Haack" wrote in message
...
I would like to be able to call some of the excel built-in functions
(specfically VLOOKUP) in some code. Can someone point me to an example
of

how
to do this?

Thanks,
Steve






  #5   Report Post  
Vasant Nanavati
 
Posts: n/a
Default

For example:

WorksheetFunction.VLookup(Range("A1"), Range("B1:D100"), 4, False)

--

Vasant

"Steve Haack" wrote in message
...
I would like to be able to call some of the excel built-in functions
(specfically VLOOKUP) in some code. Can someone point me to an example of

how
to do this?

Thanks,
Steve





  #8   Report Post  
Dave Peterson
 
Posts: n/a
Default

I like this style:

dim res as variant 'could return an error.

res = application.vlookup(worksheets("sheet1").range("a1 ").value, _
worksheets("sheet2").range("a:b"), 2, false)

if iserror(res) then
'it would have returned an #n/a error on the worksheet
msgbox "N/A"
else
msgbox res
end if

By using the application.vlookup() syntax, I get a result that can be tested
later.

Steve Haack wrote:

I would like to be able to call some of the excel built-in functions
(specfically VLOOKUP) in some code. Can someone point me to an example of how
to do this?

Thanks,
Steve


--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
mistakes in the Excel functions (help on line french version at le sergeK Excel Worksheet Functions 6 March 11th 05 08:45 PM
Suddenly cannot calculate functions or formulas in Excel Leon Hairie Excel Worksheet Functions 1 March 1st 05 04:26 PM
Excel code conversion Graham Haughs Excel Discussion (Misc queries) 1 January 29th 05 07:45 PM
EXCEL FUNCTIONS Discussion group terms Excel Worksheet Functions 1 January 7th 05 01:23 PM
HOW CAN I GET OFFICE 2003 EXCEL BASIC TO NEST FUNCTIONS LIKE EXCE. Robert AS Excel Worksheet Functions 4 December 2nd 04 10:49 AM


All times are GMT +1. The time now is 05:41 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"