Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default look up syntax

Hi all,

I made a small form to enter data in an excel sheet

Before accepting each record, i want to validate a code number

If the code exist in a simple colum on an other sheet name lookup i will
add the data
otherwise i will beep to make a warning.

if i write

If VLookup(tmp, "lookup!a1:a980", 2) Then
MsgBox "found!"
Else
beep
End If

vba tell me vlookup does not exist ???
the sheet llok up is like
a1 b1
code1 1
code2 1
code3 1

Help

Pierre


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default look up syntax

Dim res as Variant
res = Application.Match(tmp,Range("Lookup!A1:A980"),0)
If not iserror(res) Then
MsgBox "found!"
Else
beep
End If

--
Regards,
Tom Ogilvy


"Pierre" wrote in message
...
Hi all,

I made a small form to enter data in an excel sheet

Before accepting each record, i want to validate a code number

If the code exist in a simple colum on an other sheet name lookup i will
add the data
otherwise i will beep to make a warning.

if i write

If VLookup(tmp, "lookup!a1:a980", 2) Then
MsgBox "found!"
Else
beep
End If

vba tell me vlookup does not exist ???
the sheet llok up is like
a1 b1
code1 1
code2 1
code3 1

Help

Pierre




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default look up syntax

Great, it works !!!
thanks,



Tom Ogilvy a écrit dans le message ...
Dim res as Variant
res = Application.Match(tmp,Range("Lookup!A1:A980"),0)
If not iserror(res) Then
MsgBox "found!"
Else
beep
End If

--
Regards,
Tom Ogilvy


"Pierre" wrote in message
...
Hi all,

I made a small form to enter data in an excel sheet

Before accepting each record, i want to validate a code number

If the code exist in a simple colum on an other sheet name lookup i will
add the data
otherwise i will beep to make a warning.

if i write

If VLookup(tmp, "lookup!a1:a980", 2) Then
MsgBox "found!"
Else
beep
End If

vba tell me vlookup does not exist ???
the sheet llok up is like
a1 b1
code1 1
code2 1
code3 1

Help

Pierre






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
The NOW() syntax Tom Excel Discussion (Misc queries) 3 January 4th 08 04:10 PM
Syntax Help Dmorri254 Excel Worksheet Functions 2 March 2nd 05 02:51 PM
Help with VBA syntax jacqui[_2_] Excel Programming 3 January 13th 04 02:29 PM
syntax libby ~xl97 Excel Programming 1 November 19th 03 05:09 PM
syntax Don[_13_] Excel Programming 2 November 16th 03 03:30 AM


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