VBA Find What Default Text - excel

How do you prevent Visual Basic from setting the default find (Ctrl+F) text to whatever iss selected?
For clarity: In Visual Basic for Applications if you bring up a Find box it automaticaly sets the "Find What:" text to whatever you have selected in the code window. Idealy, if I closed the find box it would reopen with the find text I had last used (like every other program).
Visual Basic for Applications 7.1
Microsoft Excel 365
I've checked all the standard menus, there's not many and I'm not sure where else an option like that could be stored.
While this is technically in the Visual Basic for Applications on an Excel file I've also observed the behavior in the other office applications.

Conclusions, you can't.
After looking further and feed back from others it appears you can't change the behavior of the Find What input box within Microsoft Visual Basic for Applications. However, if you're looking to repeat a search pressing F3 to Find Next while your cursor is in the code window accomplishes much of the same thing.
Thanks JohnM, I think this is as close to an answer as I'm likly to get.

Related

Forward slash key not working in VS2019 code editor

Since a few days (I don't know exactly when it started) the forward key in VS2019 is not working in the code editor. No matter how many times I press it, it doesn't do anything.
It also doesn't work in the seach box in the menu bar (labelled 'Search (Ctrl+Q)') nor in the search box which appears with Ctrl+F.
It does work in other places, like the solution explorer search box (Ctrl+;) and in the resource editor.
The forward slash is working in any other application that I tried (including Visual Studio Code and MS Excel). The question mark (Shift+/) is working everywhere, including in the code editor window. Even AltGr+/ is working (producing the Spanish upside down question mark).
I tried all other keys, including the AltGr combinations. They all work fine. Keyboard layout is US International.
The foward slash key doesn't work in the code editor when typing it on the laptop keyboard, and doesn't work when typing it on an external keyboard, or via an RDP session.
I am running Windows 10 Pro 64-bit, version 20H2, build 19042.685. System is up to date.
Visual Studio Professional 2019, 16.8.3, also up to date.
What is causing the forward slash key to fail?
How can I solve this problem?
(Too long for a comment.)
The OP indicated that the problem was resolved after resetting the keyboard shortcuts, which suggests that / was set as a keyboard shortcut either by accident or perhaps by an installed extension.
However, the question remains in such cases of how to identify what a particular keyboard shortcut is assigned to, in order to turn off just that one shortcut as opposed to resetting all.
Visual Studio does not appear to provide a place to see the list of all active keyboard shortcuts. An alternative is to go to Tools / Import and Export Settings / Export Selected / All Settings and save a .vssettings file with all the current settings. That is a plain text file with extended XML sections, and the keyboard shortcuts can be found under the following node (reformatted for readability):
<Category name="Environment_KeyBindings" ... >
<Version>16.0.0.0</Version>
<KeyboardShortcuts>
<DefaultShortcuts>
<Shortcut Command="View.ViewCode" Scope="Global">F7</Shortcut>
...
</DefaultShortcuts>
<UserShortcuts>
...
</UserShortcuts>
</KeyboardShortcuts>
</Category>
One of the <Shortcut> lines would have been listing / before the reset, and the Command attribute on that line indicated the assignment, so that it could be located and turned off individually in Tools / Options / Environment / Keyboard.
#dxiv Your comment made me check the shortcuts. Tedious job, scrolling through those hundreds of options). Nothing. Then I clicked the Reset button. That solved the problem.
In my case, the CodeRush extension was the guilty party. "Selection comment" gets set to use / upon installation. WTG DevExpress ......
https://docs.devexpress.com/CodeRushForRoslyn/120205/coding-assistance/selection-tools/comment-uncomment-selection
Update:
Also adding a screenshot of it in VS 2022 to help people find it:

convert speech into text in excel - can this be done

I am working on a form, for which I would rather not rely on the one fingered typists in the workshop to fill in (with the inevitable typo's). Therefore I wondered if anyone know how to speak directly into some cells in excel and have that speech turned into text?
I have searched the net and constantly find the text to speech option which is the exact opposite of what I would like to do.
Although this question might be more appropriate for a different site (e.g. https://superuser.com/), here's some information that's out there.
Windows has built-in support to speech-to-text. This article is for Windows 7, but I was able to do something similar to get it to work for Windows 10 (I'm not sure what version of Windows your shop uses). I'm sure there are other commercial products you can use.
With Windows 10, I had to enable speech services, then use the Win+H keyboard shortcut to activate dictation. With Excel open and in focus, anything I said was entered into the active cell.

How to detect what Ribbon is currently active in a Microsoft Office application?

I have looked at ActiveControlList but unfortunately it wasn't a reliable way to tell the active ribbon.
Specifically, I am looking for a reliable way to tell if Equation Tools ribbon is active in OneNote.
Do you have any suggestions ?
The ribbon is not a normal control and can be hard to work with from plain VBA or ahks built-in COM but you can use Microsoft's Active Accessibility API
You Can use the Acc lib so you don't need to know all the dll calls
But you still need to know what parts you need, and also what to look for to really use it. You can use jethrows AccViewer it will tell you the elements Role, State, ChildCount and more, so when you have found the item you're after, you can use the Tree or path that the accViewer gives.
Word ribbon path Example: 4.3.4.1.4.1.4.1.4.1.4.13.1.1
OneNote: 4.3.4.1.4.1.4.1.4.1.4.10.1.1
Here is an example using Acc_get() to show the current ribbon Name in OneNote PP 2010 when you press F6
f6::
name := Acc_Get("Name", "4.3.4.1.4.1.4.1.4.1.4.10.1.1", 0, "Ahk_class Framework::CFrame")
tooltip % name
return
Note: that this path is for when the ribbon is pinned i.e always visible
Forum topic with images
As far as I know there are no specific commands for Ribbon GUIs.
Use ImageSearch to detect changes in Ribbon GUI. You can search with ImageSearch image of activated Equation Tools control and if it finds it, it will set ErrorLevel to 1.
Also, always use AutoHotkey and its documenatation from http://ahkscript.org/ (current uptodate version, new official website)! AutoHotkey and its documentation from autohotkey.com is outdated and you may have some problems using them!

Ctrl-Tab behavior in Visual Studio 2012

Question: Is there a way to make "ctrl + tab" behavior the same in VS2012 as it used to be in VS2010?
Specifically, I noticed that when you hold control and hit tab a few times, the list on the screen now ALSO includes windows that you wouldn't normally care about (much less want to switch focus to) such as: "Find Results 1", "Error List", and "Output".
These are those standard windows you typically have positioned at the bottom of your Visual Studio environment. Before, in VS2010, these types of items would not be included in the list. It was simply and easy to Ctrl-Tab to only the documents you had open. I use this feature quite a lot in order to quickly navigate amongst open files.
But now in VS2012, when you hit Ctrl-Tab and suddenly your focus is down in the error list.... its like.... what were they thinking?? You have to hit tab again to get past these useless choices, which just slows me down. If anyone knows a way to turn off this horrible new "feature", please let me know! :)
This does not happen normally.
You probably docked those windows as documents rather than as tool windows.
To check whether that's true, try docking a regular document window to the side; if you can't, that would mean that you have a vertical document split.
To fix it, undock those windows, then re-dock them using the lowest arrow.

How do I open a new tab when searching in Aptana Studio 3?

Kind of a newbie question.
Sometimes I use the project-wide search feature, and my search results appear listed in the window below, along with the related hierarchy placement.
Let's say I double click a file. It opens. Fine.
However, if I double-click again on another file in the search results window, it will replace the file I just opened. It's impossible for me to open multiple search results, short of manually opening them from the project view.
It wasn't always this way - it worked when I first installed the program, but something changed about three days in and I can't do it anymore.
Thanks!
Go to Preferences > General > Search and uncheck Reuse editors to show matches.

Resources