ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Proper syntax for this (https://www.excelbanter.com/excel-discussion-misc-queries/103162-proper-syntax.html)

Barb Reinhardt

Proper syntax for this
 
I want to functionally define a constant using this equation. Target is the
target for a worksheet change event and it's one cell in this instance.
Statics!Query_from_MS_Access_Database is a named range. You get the
picture. What do I need to change?

CompanyID = VLookup(Target, Statics!Query_from_MS_Access_Database,
2, False)

Thanks,
Barb Reinhardt


Bob Phillips

Proper syntax for this
 
On Error Resume Next
CompanyID = Application.VLookup(Target,
Statics!Query_from_MS_Access_Database, 2, False)
On Error Goto 0
If Not Iserror(CompanyId) then


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Barb Reinhardt" wrote in message
...
I want to functionally define a constant using this equation. Target is

the
target for a worksheet change event and it's one cell in this instance.
Statics!Query_from_MS_Access_Database is a named range. You get the
picture. What do I need to change?

CompanyID = VLookup(Target, Statics!Query_from_MS_Access_Database,
2, False)

Thanks,
Barb Reinhardt





All times are GMT +1. The time now is 07:08 PM.

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