After Showing Form, Select/Activate Excel Window - excel

I created a TreeView on a Form that accompanies an excel worksheet.
When the TreeViewForm.show is executed, the TreeView Form is selected. I then need to manually click on the excel window to allow scrolling through the worksheet. I need to eliminate this manual click by activating the Excel Window.
I've tried a few things
TreeViewForm.Show
AppActivate ("Excel")
Windows("TreeView.xlsm").Activate
Worksheets(SheetSelected).Activate
ActiveSheet.Cells(Target.row, Target.Column).Select
I can select cells in the worksheet; however, the Excel window isn't on-top, or highlighted. The TreeViewForm is. Thanks for your help!

Related

Select cells while userform is open

I've made a very simple userform to help some students enter data into a table. It automatically moves down the table. However, if a the data is entered wrong or needs changing, you have to close the form, select the cell, then re-open the userform because you cant select cells with the userform open.
Is there a way (I presume in the properties?) to unlock the spreadsheet to allow to manually change the active cell?

excel vba macro stopped by select sheet worksheet not found popup box

I have a macro which creates formula links in cells to many different excel files in a saved directory.
All the excel files should have the same worksheet names but sometimes one will slip through where it doesn't.
As a result this select sheet worksheet not found popup box appears and will halt the macro from continuing unless a user clicks ok or cancel.
I have tried application.displayalerts = false but it doesn't prevent this. Also tried an autoIT script but even this popup box seems to halt the script until a user clicks the mouse somewhere.
Is there a way to stop this pop up box from appearing?
excel popup box

Excel form with VBA

I was given this Excel VBA form to fix. As soon as I open it, it jumps to the form and the tool bar and all menu buttons disappear. I need to access the VBA code behind the form to fix it(atleast try). How do I get to the guts of this form. I have passwords but do not know where to enter them. Thanks in advance.
I click the sheet and a dialog box pops up:
"The cell or chart you're trying to change is on a protected Sheet. To make changes, click Unprotect Sheet in the Review tab(you might need a password)."
The problem is, I cannot see the Review Tab or any other tab. Nothing.
Open the file without activating VBA. Just open Excel, and then, in Recent Workbooks, press SHIFT and the open the Workbook. That way, the macros should not activate, and you can check the code.
Or just move the Workbook to a non trusted root, and open it.

Excel - Popup Asking for Text w/ Drop Down

Is it possible to have a macro that, when pressed, pops up a message box asking for a string of text, and then a drop down that has a list of categories?
All I would need it to do is take this information and save it into a cell. If so, how?
[I'm going based on Excel 2007 here, but if you're using 2003, you'll have to navigate the menu structure]
Go to the VBE (by going to the View tab, then click on Macro - creating or editing an existing one will take you there - or click Alt+F11).
Go to the Insert menu, and select Userform. Drag a textbox (the ab|icon), and a combobox onto your form. To set the textbox value to a cell when you change the combobox, create a subroutine in the code to do this by double clicking on the combobox.
Set the combobox items by using the .additem method of comboBox1 in your code. These can be delineated or grabbed from a range in your code (see here)
Within that subroutine, set the value of whatever cell you want to textbox1.Text, which is the contents of the textbox.

How to allow a Excel Sheet to stay active after initializing a combobox?

I wanted to know after I initialize a combobox, is there a possibility that I can still stay active with the background Excel sheet using the cursor like scroll the sheet up/down, type words on the sheet, etc?
(While at the same time the combobox still stays on top of the Excel sheet doing whatever event you might want to do with your VBA?)
Go to the VBA IDE and select your form. In the properties list (on the left hand side of the screen), find the ShowModal property. Set this to False.
This will prevent the dialog from taking over the window.

Resources