Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Handling Errors from Worksheet Functions

I have some code (snippet below) that seek to lookup a value (iuser) from a
Range (USERS), the function works fine until it encounters the #N/A return
value caused by iuser not being in the USERS array. How do I handle this
correctly?

What I am seeking to do is put the invalid iuser value into a worksheet
cell.

'<code snippet
ibarea = Application.WorksheetFunction.VLookup(iuser, Range("USERS"), 2, 0)




----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! 100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 135
Default Handling Errors from Worksheet Functions

Range("xx") is the cell of your choice:

Sub Tester
On Error Resume Next
ibarea = Application.WorksheetFunction. _
VLookup(iuser, Range("USERS"), 2, 0)
If Err < 0 Then Range("xx") = ibarea
On Error GoTo 0
End Sub

HTH,
Shockley


"Nigel" wrote in message
...
I have some code (snippet below) that seek to lookup a value (iuser) from

a
Range (USERS), the function works fine until it encounters the #N/A return
value caused by iuser not being in the USERS array. How do I handle this
correctly?

What I am seeking to do is put the invalid iuser value into a worksheet
cell.

'<code snippet
ibarea = Application.WorksheetFunction.VLookup(iuser, Range("USERS"), 2,

0)




----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet

News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! 100,000

Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption

=---



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
Statistical Functions ignoring errors excelBRISKbaby Excel Discussion (Misc queries) 1 June 7th 07 08:35 PM
Errors on Functions with many arguments Ravi Excel Worksheet Functions 1 January 11th 07 03:27 PM
errors in worksheet functions bill gras Excel Worksheet Functions 4 September 24th 05 03:08 PM
Alert for errors on a worksheet Bruce Excel Worksheet Functions 1 April 21st 05 06:08 AM
Handling errors in formulas (how annoying are they!) anon90210 Excel Discussion (Misc queries) 1 January 17th 05 01:26 PM


All times are GMT +1. The time now is 03:45 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"