ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   loop until vlookup true (https://www.excelbanter.com/excel-programming/440179-loop-until-vlookup-true.html)

Helmut

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

Don Guillett[_2_]

loop until vlookup true
 
If the intent is to fill in a number where missing then

for each c in range("c2:c22")
if len(application.trim(c))<1 then
c.value= 1099075
end if
next c

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Helmut" wrote in message
...
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



Helmut

loop until vlookup true
 
Hi Don,
No, let me explain:
Worksheet "Data" has several Tables. Table_3 has all the Kupa-numbers and
names.
On Worksheet "Input" I run the macro where people input the Kupa-number.
I want the macro to check if the number input is contained in Table_3.
If no, give chance to input another number and check
If yes, put number in specific Cell and continue with the rest of the macro.
Hope this clerifies...
Helmut

"Don Guillett" wrote:

If the intent is to fill in a number where missing then

for each c in range("c2:c22")
if len(application.trim(c))<1 then
c.value= 1099075
end if
next c

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Helmut" wrote in message
...
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


.


Don Guillett[_2_]

loop until vlookup true
 
If desired, send your file to my address below. I will only look if:
1. You send a copy of this message on an inserted sheet
2. You give me the newsgroup and the subject line
3. You send a clear explanation of what you want
4. You send before/after examples and expected results.


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Helmut" wrote in message
...
Hi Don,
No, let me explain:
Worksheet "Data" has several Tables. Table_3 has all the Kupa-numbers and
names.
On Worksheet "Input" I run the macro where people input the Kupa-number.
I want the macro to check if the number input is contained in Table_3.
If no, give chance to input another number and check
If yes, put number in specific Cell and continue with the rest of the
macro.
Hope this clerifies...
Helmut

"Don Guillett" wrote:

If the intent is to fill in a number where missing then

for each c in range("c2:c22")
if len(application.trim(c))<1 then
c.value= 1099075
end if
next c

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Helmut" wrote in message
...
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


.




All times are GMT +1. The time now is 09:32 PM.

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