Solved

Excel or Access, to automatically fill value based on previous entered data

Posted on 2011-09-20
7
385 Views
Last Modified: 2012-05-12
Hello.
I would like to do the following:
I have a list of values in a column of a table (Column Name: CODES). I must manually enter the correct correspondent code in a second comumn (Column Name: KEN).
After that I would like whenever I add a value in CODES (manually or as an import from another list), to have Excel or Access to automatically fill in the correct correspondent value in KEN column if there is one previously added.

Any answer is welcome.
Regards
 
 
 KEN.xls KEN.xls
0
Comment
Question by:inspironcrk
  • 3
  • 2
  • 2
7 Comments
 
LVL 18

Expert Comment

by:Richard Daneke
ID: 36566222
In Access, your table field Ken can be a combo box with a query that looks for distinct rows of Ken and Codes with the Codes feld as the filter criteria.   This will return any Ken values entered for a specific Code.
See attached db
Database41.accdb
0
 
LVL 31

Expert Comment

by:Rob Henson
ID: 36566339
You could set the KEN column to be a lookup of the CODE in the cells above, use a mixture of absolute and relative row references to define the cells above, top row would be absolute, row immediately above would be relative and would therefore move as the formula is copied down.

The user would then only have to input the KEN value for the first occurence of the CODE, overwriting the formula in doing so.

Thanks
Rob H
0
 

Author Comment

by:inspironcrk
ID: 36566659
@ DoDahD: I will try it right now

@robhenson: Can you be more specific? I am very rookie in coding...

Thank you
0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 

Author Comment

by:inspironcrk
ID: 36566695
@ DoDahD:

Thanks for the effort. I have the following remarks: Because there will be one to one relationship between the cells, I would like the program to automatically add the correct correspondent value if there is one.

As for the form is not the optimal way to enter the CODES, since I will import them from other tables.

Is it clear?

Regards,
Niktias
0
 
LVL 18

Expert Comment

by:Richard Daneke
ID: 36566758
since I will import them from other tables:   You can use an update query to fill the Ken values if you only have one Ken value for each Code.
0
 
LVL 31

Accepted Solution

by:
Rob Henson earned 250 total points
ID: 36566826
See attached on List2.

I have put formula in column C from row 9 downwards.

You will see that the formula in rows 9 & 11 pull the relevant KEN value from the cells above.

Whereas, the formulaw in rows 10 & 12 give a #N/A error value because they are the first occurence. For the first occurence of a code, type the KEN code in manually and then future occurences in the list will be populated by the formula.

This could be done with a VBA routine instead if so required, checking for input in column B and checking for previous occurences of the code, populating column C accordingly or requesting a code for a new occurence.

Hope this helps.
Rob H KEN.xls
0
 

Author Closing Comment

by:inspironcrk
ID: 36566881
Thank you all. I prefer the excel answer since it is easier for me to handle.
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now