How can I reference existing groups in my VBA code? - excel

I have already grouped cells in a spreadsheet using DATA>GROUP.
Based on a menu style system, I want to collapse/uncollapse a series of already created groups in a sheet, so that it only shows the selection chosen via the menu choices. I hope this makes sense.

Related

Make drop-down list permanent

I am an intern with limited VBA experience so please excuse any naivety.
There are two drop down list options (SHOWN IN THE ATTACHED LINK), the drop down list for state is permanently displayed regardless of the cell selected and is formatted in a way that makes it clear that their are options while the country drop down only appears when the cell itself is selected and an objective user would not know there is a list/choice. How do I replicate the state cell for the country cell. Is there a way to find what vba code was used for the state cell?
DROP-DOWN LIST IMAGE

How input a (rating) value in Excel cell by clicking on a (5-stars-like) object

For the purpose of building an Excel survey form, I want to create an easy rating entry system that would set values in cells based on a single click on a rating object (form control). With this click on say a 5-stars object it would return a value (from 1 to 5) based on which star is clicked (0 if not clicked), value that would be stored in a linked cell. The form should have such 5-stars objects next to a list of questions.
Using Excel built-in controls would limit option to the spin button, which isn't as convenient.
I haven't found any other suitable controls, nor ActiveX (which would make it more difficult to share the sheet).
Thanks for your insights on how I can achieve this.
If you are willing to digress from your wish to have stars as buttons, the excel form controls seem to be more than able of what you are looking for. You could use Option Buttons to achieve something like this:
A detailed guide on how to use these Buttons can be found here

ms excel - data validation for 2 drop down list

I'm looking for the solution in excel data validation for 2 drop down list.
When I choose 1st drop down list 2nd drop down list will auto populate the correct value from table. If user choose 2nd drop down list 1st drop down list will auto populate the value also.
Can someone help me on this issue ?
I attach the sample file for my problem.
enter image description here
enter image description here
thanks!
Sample File
Trying to do a two way I don't think is going to work in the way you are trying so I am not surprised the examples you found were for one-way. I am open to being corrected.
You could hack around it for example using two form control listboxes linked to the same cell so a selection in one updates the other.
Then because an item might be out of view listbox underneath have two cells which use the linked cell to index back into the source lists.
In the example above, there are two list boxes from form controls in developer tab (customize ribbon > add developer tab.
Developer tab form control - 2nd from the right
You add two of these in to the sheet.
Right click format control on each one
Set the input range to the range containing your list of values for that listbox and set the linked cell e.g. G1
Ensure that whilst you select different input ranges for each list box, they should have the same linked cell e.g. G1.
Underneath the listboxes put a formula which uses the linked cell G1 to index back into the source lists for each listbox so you can retrieve the selected value and have it visible, in case not visible within listbox.
Example testing:

Add/Remove gridlines in cells containing data in the cells

I am creating a work planner using Excel. The user selects a specific name from a drop down menu and it displays the projects. I want a table/gridline to be displayed. I would like it to add a gridline which automatically shows/hides when a name is selected but the height should be dependent on the rows of data. So if there are a 5 projects the table should be 5 columns long.
I have implemented a formula using Conditional Formatting (=NOT(ISBLANK(D6))), but the table still shows if I select the default option which shows no names.
Bit tricky without knowing what's in D6! - but presume it's your dropdown... in which case don't you want this an absolute reference $D$6?
One other thing to try is having multiple rules, so setup conditional formatting so that ISBLANK(D6) then no borders (make sure it's the first rule and to tick 'stop if true' to stop it running through to your NOT(ISBLANK) rule)

Excel: Is there a way to programmatically change the background colours of individual cells in a multi column listbox control

I have a multi-column list box control embedded in Excel, is there a way to change the background, font, and other attributes of an individual cell (rather than changing all the text in the listbox)?
I don't mind which listbox control I use (activeX or otherwise).
I would also consider using another control that isn't tied into the excel worksheet rows and columns (i.e. I can't use a table).
Excel's built in listbox control doesn't really have formatting options, but you can do quite a bit with the listview control.
You'll have to add a reference to Microsoft Windows Common Controls 6.0 (from VBA window go to Tools and click References, and scroll to find it). There's not an effective way to change the background color of a single cell in the listview table, but you can change the font color and make text bold in specific cells or based on criteria.
The syntax to populate the listview is a bit different than listbox, but there's quite a bit of material online for this if you think its the way to go. Also - I have only used listview in a form, but it should be possible to add this as an ActiveX control in an actual sheet.

Resources