oleobjects
RH

Forum home » Delegate support and help forum » Microsoft Excel Training and help » OLEObjects

OLEObjects

resolvedResolved · Medium Priority · Version 365

Alfie has attended:
Excel Advanced course

OLEObjects

My main goal is to create a data validation drop down list with a code and the description associated with said code. E.g. P20 - Pepperoni Pizza, P15 - Vegetarian Pizza. I know I can achieve this with a combo box however I require as many as 300 of these drop down lists with in one form. I require the spreadsheet to remain lightweight so it can be easily up/downloaded and shouldn't require any additional knowledge to operate as many others will use the form. I've done some looking and it looks like I need to understand OLEObjects to manipulate a single dropdown box to interact with the multiple cells. Unfortunately I cannot find much source material and was hoping to gain assistance on said subject or at least be pointed in the right direction.
Many thanks,
Alfie

RE: OLEObjects

Hi Alfie,

Thank you for the forum question.

If you want to interact with several cells you will need to know VBA and code ActiveX controls.

It is not an easy task. We code user forms on our Excel VBA intermediate course and the logic and code to code user form controls, is the same logic as the code you need to code ActiveX combo boxes.




Kind regards

Jens Bonde
Microsoft Office Specialist Trainer

Tel: 0207 987 3777
STL - https://www.stl-training.co.uk
98%+ recommend us

London's leader with UK wide delivery in Microsoft Office training and management training to global brands, FTSE 100, SME's and the public sector

RE: OLEObjects

I've worked a little with user forms in VBA and having it interact with the spreadsheet by pulling values both ways. e.g Manipulating combobox lists, pasting values into the spreadsheet, opening and closing the form, in addition to some other relatively simple object interactions. I'd assume it's a step up the feat I am trying to achieve, but I like a challenge and was hoping maybe there could be some material I can read/work through to wrap my head around such a task. Or similar code that I can reverse engineer/dissect to strengthen my understanding.

RE: OLEObjects

Hi Alfie,

You can find many videos on Youtube about VBA userforms, but to find one which explain exactly what you will need to do will not be easy.


Everything can be done different ways based on your Excel knowledge, logic and VBA knowledge.

Based on my understanding of what you want to achieve You can use datavalidation to get the dropdown lists and then VBA coding, you can create a userform, you can code ActiveX controls, and you can use form controls placed on the worksheet and based on what is selected you can use VBA code to do what you want to achieve. You can probably also work with UI, Python, Power Query, or VB coding.

And may be it can be done without any coding with Excel worksheet functions.

Where do you have the source for the dropdowns/combo boxes and how is the source structured? You wrote that you need 300 combo boxes. Do all 300 have the same source or do you have 300 different sources?

How is the output structured? Do you want to select something for each record (each row) in a list?

What would you like Excel to do when something is selected from a dropdown/combo box?

You wrote: "manipulate a single dropdown box to interact with the multiple cells"

Do you want to look up a price? If yes do you have a price list and how is it structured and how do you get the pricelist updated?

You wrote: " I require the spreadsheet to remain lightweight so it can be easily up/downloaded and shouldn't require any additional knowledge to operate as many others will use the form."

I do not know your understanding of best practice working with Excel. To keep files lightweight depends on how the file is structured, which tools are used, how it is "cleaned", how formulas are written, and which functions are used and of course how many records are stored in the file.

It is not easy with the knowledge I have about what you want to do, to point you in the right direction. I don't want to send you in a wrong direction where you end up not been able to do what you want.

I have raised some questions above, but before I can send you in the direction I would use I need in depth to understand your needs.


I hope my answer have been giving you some ideas of the options you have. If you decide for a VBA solution, I will be happy to have a look at your code, if you run into any problems.

Kind regards

Jens Bonde
Microsoft Office Specialist Trainer

Tel: 0207 987 3777
STL - https://www.stl-training.co.uk
98%+ recommend us

London's leader with UK wide delivery in Microsoft Office training and management training to global brands, FTSE 100, SME's and the public sector

RE: OLEObjects

Thank you so much for the response Jen, I will Explain this in as much detail as possible.

I have a spreadsheet, which I will refer to as the "Form", is used for reconciling different documents such as receipts, invoices, credit notes. The people that use the Excel spreadsheet input the data from those documents and that's as far as their excel knowledge goes. So the Form must be user friendly to anyone no matter their excel knowledge. My job is to improve this form without changing its primary function or the premise of the form.
Meaning I'm focusing on simple protected functions and simplifying/automating the process of inputting generic information. One very common is the two codes people generally input (or in most cases forget to input).
I will focus mainly on one which is a descriptor code. Like in my first post about Pizza, I have a source of data which is secured in another sheet on the excel document I currently have a data validation list connected to the source to create a drop down of the different codes. The main issue is upon talking to the users of this form the main issue is they forget which code relates to which descriptor. I want to not have the users having to switch between the sheets I want it so the descriptor is beside the code. From my current knowledge I understand this is doable with comboboxes - as I've done similar for a single combobox in a Userform totally unrelated to this document.
However, there is between 100-150 lines of inputted data each row would require a combobox for primarily the descriptor code. My experience with comboboxes in excel sheets is after just a handful in a spreadsheet with automatic functions it can start to slow and become relatively large. The document must be able to be inputted on slower systems such as an old model laptop. Be uploaded to and downloaded to and from a system called Box before being uploaded to a in house accounting system - once I clean and audit said data.
A little googling said I'd be able to achieve this using a single combobox that appears at the selected location, when you click on a specified predefined range of cells. Trying to pull on this string connected to OLEObjects and trying to find material to elaborate on how to code around them I reach dead ends or unhelpful information.

As for my knowledge assume my current knowledge is that of a basic level. With the capacity to navigate the more complex coded lines and reverse engineer them as long as I'm provided with a sheet said code works on or a simplified description of how the code works, so I can replicate and test it. My knowledge on some very specific errors is what I was told is advanced but the method I take to learning is very targeted so although I can operate some more complex things I know little of the basics for most other areas, this method provides the fastest results for me in producing a finished product.

I hope this is detailed enough, excuse my lack of jargon.
If I can be provided with a starting point around this topic with enough information on it I should be able to go from there and build my own (potentially less efficient) but working code - I can work on improving it after I get it to operate correctly.

Kindly,
Alfie

RE: OLEObjects

Hi Alfie,

I hope I understand you right. Please have a look at attached Excel file, and let me know if it is not what you want to do.

I have the data in the table tool so you can add new records without have to update the form or the source for the dropdown.

Kind regards

Jens Bonde
Microsoft Office Specialist Trainer

Tel: 0207 987 3777
STL - https://www.stl-training.co.uk
98%+ recommend us

London's leader with UK wide delivery in Microsoft Office training and management training to global brands, FTSE 100, SME's and the public sector

Attached files...

Pizza.xlsx

RE: OLEObjects

I had a feeling it could be done this way I thought it would be nicer to have just the code inputted into the cell, is there anyway to achieve this - just because the code is used in descriptions; when I upload it's Concatenated a few times and I'd have to adjust it with an imbedded Left() code.
However, if this is not the case I believe sticking with this method may be the most efficient way to keep moving forward.
If so Thank you very much for your help.

RE: OLEObjects

Hi Alfie,

If the code is everything to the left in the cell before the first space, you can use the left and search function to extract only the code:

=Left(A2,Search(" ",A2)-1)

In my example above I assume that the first code is in cell A2.

Kind regards

Jens Bonde
Microsoft Office Specialist Trainer

Tel: 0207 987 3777
STL - https://www.stl-training.co.uk
98%+ recommend us

London's leader with UK wide delivery in Microsoft Office training and management training to global brands, FTSE 100, SME's and the public sector

RE: OLEObjects

Hi Alfie,

Please let me know if you cannot see the attachment.

About been able to open the file on slow laptops. Make sure that the file is cleaned from unnecessary data. Files can get heavy from a large number of reasons as mentioned earlier.

Kind regards

Jens Bonde
Microsoft Office Specialist Trainer

Tel: 0207 987 3777
STL - https://www.stl-training.co.uk
98%+ recommend us

London's leader with UK wide delivery in Microsoft Office training and management training to global brands, FTSE 100, SME's and the public sector

Mon 17 Jan 2022: Automatically marked as resolved.

 

Training courses

 

Training information:

See also:

Welcome. Please choose your application (eg. Excel) and then post your question.

Our Microsoft Qualified trainers will then respond within 24 hours (working days).

Frequently Asked Questions
What does 'Resolved' mean?

Any suggestions, questions or comments? Please post in the Improve the forum thread.


 

Excel tip:

Creating custom lists

In Excel if you type in January in a cell, you can then copy this cell to replicate Febraury, MArch, April etc.

This list has come from Tools- options and Custom lists.

Therefore to save time and create your own list you can click on New (in Tools and custom list tab) and type out the lsit that you want copied quickly.

All you have to do is then type in the 1st word and you will be able to copy the rest of the list quickly.

View all Excel hints and tips


Server loaded in 0.06 secs.