Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 430
Default Bypass entry of data from Lookup Table

On an Entry form (Userform) I'm trying to allow for the Entry of
new items MANUALLY that are not in a pre-defined lookup table.
My line 3 and 4 below is a poor attempt at doing so <<IS NOT WORKING; Can
someone
suggest the code to allow me to enter all 7 fields manually?
TIA,


Private Sub cbVenCode_AfterUpdate()
Set MyVenTable = Range("VenTable")
If Application.VLookup(Me.cbVencode, MyVenTable, 2, False) = "" Then
Exit Sub
End If
txtVenName.Value = Application.VLookup(Me.cbVencode, MyVenTable, 2,
False)
txtVAdd1.Value = Application.VLookup(Me.cbVencode, MyVenTable, 3, False)
txtVAdd2.Value = Application.VLookup(Me.cbVencode, MyVenTable, 4, False)
txtCity.Value = Application.VLookup(Me.cbVencode, MyVenTable, 5, False)
txtSt.Value = Application.VLookup(Me.cbVencode, MyVenTable, 6, False)
txtZip.Value = Application.VLookup(Me.cbVencode, MyVenTable, 7, False)
Set MyVenTable = Nothing
End Sub


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Bypass entry of data from Lookup Table

if iserror(application.match(me.cbvencode,myventable. columns(1),0)) then
'allow manual entry
'make the textboxes enabled?
else
'just show the values
'and disable the textboxes so no changes can be made?
end if

Maybe....

Jim May wrote:

On an Entry form (Userform) I'm trying to allow for the Entry of
new items MANUALLY that are not in a pre-defined lookup table.
My line 3 and 4 below is a poor attempt at doing so <<IS NOT WORKING; Can
someone
suggest the code to allow me to enter all 7 fields manually?
TIA,

Private Sub cbVenCode_AfterUpdate()
Set MyVenTable = Range("VenTable")
If Application.VLookup(Me.cbVencode, MyVenTable, 2, False) = "" Then
Exit Sub
End If
txtVenName.Value = Application.VLookup(Me.cbVencode, MyVenTable, 2,
False)
txtVAdd1.Value = Application.VLookup(Me.cbVencode, MyVenTable, 3, False)
txtVAdd2.Value = Application.VLookup(Me.cbVencode, MyVenTable, 4, False)
txtCity.Value = Application.VLookup(Me.cbVencode, MyVenTable, 5, False)
txtSt.Value = Application.VLookup(Me.cbVencode, MyVenTable, 6, False)
txtZip.Value = Application.VLookup(Me.cbVencode, MyVenTable, 7, False)
Set MyVenTable = Nothing
End Sub


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 430
Default Bypass entry of data from Lookup Table

Thanks Dave;
I got it going, as I wanted it.
Jim


"Dave Peterson" wrote in message
...
if iserror(application.match(me.cbvencode,myventable. columns(1),0)) then
'allow manual entry
'make the textboxes enabled?
else
'just show the values
'and disable the textboxes so no changes can be made?
end if

Maybe....

Jim May wrote:

On an Entry form (Userform) I'm trying to allow for the Entry of
new items MANUALLY that are not in a pre-defined lookup table.
My line 3 and 4 below is a poor attempt at doing so <<IS NOT WORKING;
Can
someone
suggest the code to allow me to enter all 7 fields manually?
TIA,

Private Sub cbVenCode_AfterUpdate()
Set MyVenTable = Range("VenTable")
If Application.VLookup(Me.cbVencode, MyVenTable, 2, False) = "" Then
Exit Sub
End If
txtVenName.Value = Application.VLookup(Me.cbVencode, MyVenTable, 2,
False)
txtVAdd1.Value = Application.VLookup(Me.cbVencode, MyVenTable, 3,
False)
txtVAdd2.Value = Application.VLookup(Me.cbVencode, MyVenTable, 4,
False)
txtCity.Value = Application.VLookup(Me.cbVencode, MyVenTable, 5,
False)
txtSt.Value = Application.VLookup(Me.cbVencode, MyVenTable, 6, False)
txtZip.Value = Application.VLookup(Me.cbVencode, MyVenTable, 7,
False)
Set MyVenTable = Nothing
End Sub


--

Dave Peterson



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
Remove a column but not data table entry ClaireP Charts and Charting in Excel 4 October 9th 09 06:32 AM
Lookup data in a variable table & retrieve data from a pivot table Shawna Excel Worksheet Functions 3 October 10th 08 11:11 PM
Data Entry Online, Data Format, Data Conversion and Data EntryServices through Data Entry Outsourcing [email protected] Excel Discussion (Misc queries) 0 March 20th 08 12:45 PM
Data entry table, pivottable like frédéric Excel Discussion (Misc queries) 0 July 24th 07 11:48 AM
lookup misses the first entry in table Spunky Excel Worksheet Functions 1 January 17th 05 08:29 PM


All times are GMT +1. The time now is 08:09 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"