VBA button action issue on cell edit - vba

I have an excel toolbar created by VBA macros. When cell is in edit mode, I'm unable to perform any toolbar actions, the event itself is not getting triggered. Button events are getting triggered when we come out of that editing cell.
Is there any way to handle this? I want to allow users to click on buttons even when cell is in editing mode.
Thanks.

VBA will never run if a cell is in edit mode. If you are typing inside a cell, VBA is halted. Infact, if you press ALT + F11 and bring up the VBA editor window, and then go to edit a cell in Excel, you'll find you cant ALT + TAB back to the editor, it's gone. You cant even get back to the editor whilst you are in edit mode. (Obviously when you click outside Excel, the cell is no longer in edit mode, so you can select it from the windows tray)
You may have to use a form to allow users to edit cells, this way VBA will still run whilst the form text box is being typed in. Then submit it to the cell when the text box is complete

Related

How do I make a userform appear on demand in Microsoft Word?

I can make it popup on opening the document, but what if I close the userform and want to it to show up again in the same document? I know in excel you can add a button onto a worksheet directly and make it show the userform on click, but this button is unavailable for microsoft Word. Is there a solution besides initiating the script by hand?
To display a VBA userform, you can trigger it from a macrobutton field, from a form field, from a shape, from a QAT button or from an ActiveX button. There are probably a couple of other methods I'm not remembering at the moment. Each is a little different in the exact steps, but all will run the command:
UserFormName.Show

How do I disable the cut button on excel 10 ribbon

I am trying to disable the cut function/button on the ribbon. I have a situation where there are a number of formulae that are reliant on data input cells. If those cells are cut and pasted elsewhere the formula follows the cell. I have disabled right click and keyboard shortcut but cannot disable the ribbon cut function. I downloaded a spreadsheet from another thread with a similar requirement which had no cut button on the Home ribbon but cannot see any code to show how it was achieved. Soooo! If anyone can help it would be awesome.

Hide VBA codes when double clicking controls buttons

I have inserted a combo box on PPT slide. When I double click the combo box, the VBA editing window will pop up. Is there a way that when I double click the box, VBA code does not pop up? I don't want users to see my actual codes and VBA window in general.
Thanks in advance!
I think you might have design mode on. Have a look under Developer > Controls > Design Mode. Turning it off should remove that behaviour.

excel 2003 vba get cell value in edit mode

I want to make an ajax like search in excel 2003 vba. I found a script that can catch button presses.Here -> Is there any event that fires when keys are pressed when editing a cell?
The problem is how to get the text you are currently editing? It will be put in the Cell.Value only after you hit enter.
I was thinking you know what the cell.Value was when you started editing and you can apply the button pressies to it. This would work till you don't use the mouse to change the cursor position.
If you're able to detect the key-presses, you could just build up a string of each character pressed until the enter key is pressed, although you might have to handle special keys like line-breaks, arrow-keys, insert, delete and backspace, and Cut/Copy/Paste.

How can I trigger a click event of an invisible control?

I have a background for my VBA project which contains pictures. These pictures I would like to make clickable, in the way that the click triggers a click event. I've tried adding pictureboxes, buttons and labels but I couldn't manage to make them invisible without making the click event not work (setting the Visible property to false causes this). Googling the problem, most solutions made the button look transparent by changing the color and borderstyle so the control appeared to be a part of the mono color background. I however have a specific picture that I would like to see beneath the button.
To add a macro manually
Right-click on the picture you want to assign the macro to.
Choose Assign Macro from the options.
Assign the macro that you want to run when the picture is clicked.
Click OK to finish.
To add a macro programmatically
If the macro is in the same workbook:
ActiveSheet.Shapes("Picture 1").OnAction = "ThisWorkbook.test"
If the macro is in a different workbook:
ActiveSheet.Shapes("Picture 1").OnAction = "'Book1'!test"
For more examples, look at this and this.