Bloomberg Short Cuts in EXCEL - excel

Is there a method to remove or at least disable Bloomberg keyboard short cuts in Excel?
For example, normally to open a filter I can press CONTROL + SHIFT + L. However, this shortcut is now being used in Bloomberg and it causes my Excel to either freeze or not load for some time.

Go to the Bloomberg tab in the workbook, select Options -> Hot Key Manager and disable Bloomberg hotkey (top right corner)

Run the following code in VBA:
Public Sub DisableBloomberg()
Application.OnKey "+^l"
End Sub
This should disable them, if you are lucky :)
Here you can read more about Application.OnKey.
If you do not know what VBA is, then in Excel do the following:
Press Alt+F11
Press Ctrl+G
Write Application.OnKey "+^l" to the opened window and press Enter

Related

VBA Excel - Replace Enter key with Alt+ Enter

I am trying to replace Enter key with Alt+Enter so that I can write multiline in cells with ease.
I have seen that there is a function Application.OnKey and Application.SendKeys and I wanted to use those something like this:
Application.OnKey "~" , Application.SendKeys("%~")
But where do I place those? Or any other ideas?
I think I agree with #Andreas, this is unlikely to work using these methods.
This is what I tried: I made a button Button1 and in its click method I assign the Enter key to send Alt-Enter as you suggest in the question:
Sub Button1_onClick()
Call Application.OnKey("~", "SendAltEnter")
End Sub
Sub SendAltEnter()
Application.SendKeys ("%~")
End Sub
This does in fact re-route the Enter key, but apparently the Alt-Enter results in another call to the method for the "Enter" part of "Alt-Enter" -- it results in an infinite loop the first time you hit enter after having clicked the button, and you have to restart your Excel application to clean it up.
I also tried this, simply using another key near Enter, namely # (at least on German keyboards) which you could hit instead of Alt-Enter:
Sub Button1_onClick()
Call Application.OnKey("#", "SendAltEnter")
End Sub
Sub SendAltEnter()
Application.SendKeys ("%~")
End Sub
The key '#' is intercepted, but not if you are in input mode in a cell, only if the focus is somewhere in the worksheet.
I think you'll have to do this outside of Excel using a keyboard remapping tool for Windows. I quickly found https://www.howtogeek.com/710290/how-to-remap-any-key-or-shortcut-on-windows-10/ by googling but know nothing about it or if it is legit or not.
Have you considered just using Shift + Enter to insert a carriage return instead?

Cannot program application.onkey for alt+0 in Excel 2016

In Excel 2016 it seems I cannot program alt + 0 anymore to run a VBA subroutine of mine, in other words
application.onkey "%0", "mysub"
. The default behaviour (to temporary show the ribbon, if hidden) cannot be changed, it seems. But now I also lose alt + shift + 0, in other words the following also does not work:
application.onkey "%+0", "mysub".
Is there any way to have application.onkey override the default action? Thanks
Thanks, I found the problem now: I had done the ctrl + shift + f1 toggle beforehand. This makes Excel fullscreen and totally hides the ribbon. While hidden, alt + 0 becomes the shortcut to temporarily show the ribbon, and application.onkey "%0", "mysub" won't work.
Apologies, it was not my intention to answer my own question from the start... But #jkpieterse motivated to me try harder.

Can I simulate pressing the Enter key in an Excel macro?

I am using an Excel macro to perform a text-to-speech readout of text in a specific cell:
Range("$D$10").Select
Application.Speech.SpeakCellOnEnter = True
This requires the user to press the Enter key after the macro is called for this to be activated. That means two actions by the user, since the macro is called by the user clicking a "Listen" link on the sheet. Is there a way to simulate the Enter key press within the macro? Or is there a better option for text-to-speech?
Include the Sendkeys in your Macro
Application.SendKeys "{ENTER}"
Range("$D$10").Select
Application.Speech.SpeakCellOnEnter = True

Delete cell content after enter key?

Excel I need it to delete what I type right after I press enter is this possible? This might be easy but I don't know how to.
Yes I am using this data I need it to send the data and then delete itself with the results from that data in.
This is what I have so far: "=COUNTIF(B2;C8)" so if the b2 matches c8 then it adds one and I need it to delete the b2 automatically so that I could enter new value.
Go to File > Options. This will open a window, select the second tab Formulas. Check the box Enable Iterative Calculation.
Note, that this box will uncheck itself if you install updates.
Ta da!!!
Place the following event macro in the worksheet code area:
Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
Target.ClearContents
Application.EnableEvents = True
End Sub
Because it is worksheet code, it is very easy to install and automatic to use:
right-click the tab name near the bottom of the Excel window
select View Code - this brings up a VBE window
paste the stuff in and close the VBE window
If you have any concerns, first try it on a trial worksheet.
If you save the workbook, the macro will be saved with it.
If you are using a version of Excel later then 2003, you must save
the file as .xlsm rather than .xlsx
To remove the macro:
bring up the VBE windows as above
clear the code out
close the VBE window
To learn more about macros in general, see:
http://www.mvps.org/dmcritchie/excel/getstarted.htm
and
http://msdn.microsoft.com/en-us/library/ee814735(v=office.14).aspx
To learn more about Event Macros (worksheet code), see:
http://www.mvps.org/dmcritchie/excel/event.htm
Macros must be enabled for this to work!

How to run a VBA add-in macro from Excel using the Application.OnKey shortcut?

I have an Excel add-in in which I have several macros, some that have the Application.OnKey method to enable the user to use a specific keyboard shortcut to run a certain macro.
Accessing the code in the add-in requires a password.
This is a simple example of a macro:
Sub refreshMySelection()
Application.Selection.Calculate
Application.OnKey "^{ENTER}", "refreshMySelection"
End Sub
This is meant to allow the user to refresh selected Excel cells by only typing Ctrl+Enter.
However, for some reason, Excel does not automatically recognize this shortcut. Unless I manually open the add-in and execute the above macro, then only the current active workbook would do the job i.e. refresh selected cells when typing Ctrl+Enter.
# Thinkingcap, your suggestion works perfect, thanks !
Add the below in the addin
Sub Auto_Open()
Application.OnKey "^{ENTER}", "refreshMySelection"
End Sub

Resources