Hide/unhide specific cells - excel

Is it possible to create a code that allows a button to hide specific cells (e.g. (B10:B15) + C17 + C19 + (D10:D18)) when pressed and then have the reappear when pressed again? Alternatively another button for the reapearing can be accepted.

You cannot hide a single cell. But if you want to hide/unhide e.g. a number of columns using a shortcut key you can do as follows:
In the View toolbar, click Macros, then Record Macro....
Enter a key, under shortcut key (Ctrl + ...). [Let's assume you put 'h'] Then press OK.
Hide the columns you want to hide (or anything you want to happen by pressing the shortcut key).
Goto View toolbar, click Macros, then Stop Recording.
Now when you press the defined shortcut key (e.g. Ctrl+h), the desired columns will hide.
You can follow the same steps to define a different shortcut key for unhiding.
If you want to make some single cells (kind of) invisible, you can do that by changing the font color to match the background color. Again you can use the same steps mentioned above to create a shortcut key for that.

Related

EXCEL Prevent range from being deleted

I want to be able to delete or add rows in Section A without moving Section B without protecting the sheet.
Is there a way to sort of 'freeze' all those columns so they won't move? so if the user just wants more columns they can just right click on a entire row to add, or delete
Help is appreciated!
Delete
Select exactly what you want to delete. Press Ctrl + - (Control and Minus Sign) or choose Delete... in a context menu. Choose Shift cells up in a pop-up menu.
Insert
Select the range to insert. Press Ctrl + + (Control and Plus Sign) or choose Insert... in a context menu. Choose Shift cells Down in a pop-up menu.
Answer to additional question
Is there a way to sort of freeze all those columns so they won't
move when the user wants more rows to add?
In general - no. But if you manage to convert the left side (A in your picture) into an Excel Table aka Excel List then you can operate with rows and columns inside of it.

Hi, how to change the value in the dependent drop down list immediately after copying the drop down to another cell in excel

I have created a dependent dynamic drop-down list based on another drop-down. Please check the below image. However, when I am copying the drop-down to another cell, Although the drop-down list is getting updated based on the dynamic reference, the value that was selected earlier was not changing.
For example, as shown in the below image. I have copied the drop-down that has a value of 4.09 to another cell. As you can see although the drop-down list got updated the value 4.09 is not changing. I ideally expect it to change as 4.09 is not a part of this dropdown list values. could anyone help me how can I achieve this?
See my screenshots below - here are two options you can consider (once you've pasted the value corresponding to 4.09 into a cell, it will remain that way until it's changed by some mechanism other than validation lists - if I've interpreted/understood your Q properly - these lists are only designed to capture an input not change other cells)..
Option 1:
Use develeper tab 'combo box' option:
I've inserted this combo-box so that it aligns with cell D2 (hold 'alt' when dragging edges with mouse to align pefectly with neighbouring cell adjacencies).
Notice the two cells in F3:G3 - the former corresponds to your validation-list selection (which is what I understand you really want to achieve, the second is a simple lookupp to bring back the valee itself
Input range: B3:B7
Linked cell: G3
Customise according to your specific needs/set-up noting my example is purely demonstrative.
Now whenever I make a new selection (e.g. light build or q
Option 2 - use worksheet_change VB code:
shorcut keys: (alt + F11 to open VB; CTRL + R to view Project Explorer if (default) view not already showing; double click sheet in question (here Sheet1) to open VB editor pane, insert following code:

How to enable multipleselection in qtreeview till ctrl key is pressed in pyqt5?

I have a qtreeview, in which i want to enable mulitple row selection only when ctrl key is pressed .
For multiple row selection i was using setSelectionMode(QAbstractItemView.MultiSelection)
But found out that it looks odd means if i simply clicked a item it get selected. I don't want that. I want to select multiple rows selection only when ctrl is pressed.
Use ExtendedSelection rather than Multiselection.
tree.setSelectionMode(QAbstractItemView.ExtendedSelection)

Userform Excel: finding the order of the code(buttons etc), inorder to change, so the user can press 'tab' on form and it will move to the next one

I want to fix the order of the cursor when the user presses 'tab' to go in order. Not sure where the order is, i've tried moving around everything in the VBA
Each object on the Userform has a TabIndex property, adjust the numbering for each object to adjust the order.

Edit text in an Excel column without deleting the current content

I'm at work and this is my first time using Excel.
I have the following question:
When I want to edit text in a column, I can press Enter or Spacebar to do so without using the mouse.
However, this way the whole text gets deleted.
Now, I want to edit text while keeping the text in the current column.
(And, yes, I'm definitely too lazy to use the mouse.)
Thank you very much, everybody. :)
NAvigate to the cell you want and then press "F2" key, this will allow you to edit the text in the selected cell. Just change and press enter!

Resources