473,609 Members | 1,972 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

I need help with setting up a lookup table, or another way to do this

1 New Member
I am currently trying to work with two workbooks. One is where data is gathered where I am wanting to compare row 6 values that are what the values should be and compare this to row 8:23 where data is entered. However, the values can be within a certain tolerance, and I have the tolerances located in another workbook. Below is my code, but it is located in the worksheet object so everytime the worksheet is changed the tolerance table opens. Any suggestions would be helpful.

Expand|Select|Wrap|Line Numbers
  1. Private Sub Worksheet_Change(ByVal Target As Range)
  2. Dim LResult As String
  3. Dim i As Long
  4.  
  5.     WorkingSheetWBookName = "Workbook 1.xlsm"
  6.     WorkingSheetChange = "Worksheet 1"
  7.     ReferenceSheetName = "Tolerance Lookup"
  8.     ReferenceSheetWBookName = "Reference Sheet working copy.xlsx"
  9.     ReferenceSheetWBookLocation = "D:\Reference Sheet working copy.xlsx"
  10.  
  11. LResult = Mid(Worksheets(WorkingSheetChange).Range("D4").Value, 11, 2)
  12. If LResult = ("PW") Then
  13.     ReferenceSheetCheck
  14.     For i = 8 To 23
  15.         If Cells(i, 3).Value > Range("C6").Value + Workbooks(ReferenceSheetWBookName).Worksheets(ReferenceSheetName).Range("B2").Value Then
  16.            Cells(i, 3).Font.ColorIndex = 1
  17.            Cells(i, 3).Font.Bold = True
  18.            Cells(i, 3).Interior.ColorIndex = 3
  19.         Else
  20.             Cells(i, 3).Font.ColorIndex = 1
  21.             Cells(i, 3).Font.Bold = False
  22.             Cells(i, 3).Interior.ColorIndex = 0
  23.         End If
  24.     Next i
  25. End If
  26. End Sub
  27.  
  28. Private Sub ReferenceSheetCheck()
  29. On Error GoTo OpenIt
  30. Application.Workbooks(ReferenceSheetWBookName).Activate
  31. GoTo Quit
  32. OpenIt:
  33. Workbooks.Open ("D:\Reference Sheet working copy.xlsx")
  34. Quit:
  35. End Sub
  36.  
  37.  
Jun 28 '13 #1
1 1893
Rabbit
12,516 Recognized Expert Moderator MVP
Your thread has been moved to the Excel forum.

And what trouble are you having?
Jun 28 '13 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
2015
by: Guyle Taber | last post by:
I'm trying to do a lookup from a table where an ID number equals a name. But in selecting from three tables, I can't seem to figure out how to display the data in the fashion I need. In the first table (user_contact), I have contact info for each user and the user ID. In the second table (user_info), each user ID will have a primary genre, and an alternate genre (as an ID number). The third table holds the lookup information for...
1
3353
by: James | last post by:
I am used to VB6 but need to develop something in .Net. I need to create several bound combo-boxes which will use lookup tables to get their values. I created a form using the dataform wizard. As part of the setup, I specified a new dataset, which included the data & lookup tables. I also specified the relationships when required. I then added a combo box control to my form, following the instructions from
3
2279
by: dbuchanan | last post by:
Hello, (Windows forms - SQL Server) I fill my datagrid with a stored procedure that includes relationships to lookup tables so that users can see the values of the combobox selections rather than the key value that are stored in the table. It works well if the comboboxes are selected when the row is created.
0
919
by: Tales Mein | last post by:
Hi what's the best way to implement a form like this Main Form Enter User name, address, phone. Lookup product and select one. Return to Main form Save all
11
2643
by: Paul H | last post by:
Suppose I have a table called tblPeople and I want a field to illustrate whether each person prefers cats or dogs. I could do it one of three ways. 1. A plain text field Create a text field in tblPeople called PreferredPet. 2. A lookup field that stores text values. Create a text field in tblPeople called PreferredPetID and use it to lookup an identical text field in tblPreferredPets.
5
4007
by: sensreview | last post by:
Hello, I need help in selecting a value from combo list thru one lookup table and update different table on MS access form. For eg; I have a lookup table of usernames, I need to use this lookup table in all my other forms to update different table selecting the username from my lookup table. I tried Docmd.runsql but unable to succeed.
5
12652
by: Andrus | last post by:
I'm creating a database Winforms application using VCS Express 2005 I have some large lookup tables (may be up to 500000 records) which contains name and id and are stored in sql server. I need to create single line combobox style control which: 1. Allows to type first characters in name 2. Auto-completes entered data by using first match 3. Allows to open picklist based by entered data and select name
7
1864
by: mykathy127 | last post by:
hi, im setting up a database that will join the contents of 2 tables once this text is found on the other table. for example: table 1 will contain the following: Structure Column FZER-2DER/PT1
15
2271
ajhayes
by: ajhayes | last post by:
I posted a question here last week about an ordering database I'm trying to set up, and got some excellent help. So I'm hoping some of you might be able to get me on the right track with another question I've got on the same project. Here's some general info on what I've done so far (For the record, I'm quite a novice at this.): The database I'm setting up is for a small electric utility company to submit orders to the inventory warehouse...
10
1802
by: sarahaziz | last post by:
Hello guys i have a table in DB that has messages exchanged between groups and i need yo create a table like this one (messages exchanged between 2 groups) knowing that Gr1,.... are group names from DB and numbers are from DB too. http://www.freeimagehosting.net/uploads/10b1fb8eeb.jpg
0
8095
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8236
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6068
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5526
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4037
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4103
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2541
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1690
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1407
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.