View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Helmut Helmut is offline
external usenet poster
 
Posts: 111
Default loop until vlookup true

I need code which will do the following:

When I input the Kupa number i.e. 1099075 it needs to verify that this code
exists on table_3 when it does not exist i.e. vlookup=FALSE, then I need to
loop through beginning and ask person to input correct Kupa number. When no
longer FALSE, then put number: Range("F2:G2").Select // Range("F2:G2").Value
= Account

' Input Kupa Account Number

Dim Message, Title, Default, Account

Message = "ìäëðéñ îñ' ä÷åôä ùì äòåáã" ' Set prompt.
Title = "Input Box" ' Set title.
Default = "109xxxx" ' Set default.

' Display message, title, and default value.
Account = InputBox(Message, Title, Default)

------------------------
If WorksheetFunction.VLookup(Account, Table_3, 2, False) = False Then

loop-code until number in table
------------------------
Range("F2:G2").Select
Range("F2:G2").Value = Account

Thanks