Jump to content

Recommended Posts

Hi

 

Any ideas on how to create a hotkey that creates a SUM formula using the selected cells?

 

J

Share this post


Link to post

That's really an Excel question, and I think you'll have more luck asking on an Excel-related forum. 

 

I suppose it's possible there are some Excel scripting gurus kicking around on this forum, but I wouldn't hold my breathe.

 

Share this post


Link to post
On 13/07/2017 at 6:57 PM, iJemz said:

Any ideas on how to create a hotkey that creates a SUM formula using the selected cells?

 

10 minutes ago, GuiB said:

CMD + SHIFT + T  ?? There's already a keyboard shortcut for that in Excel if I clearly understand you question...

 

So what are you asking, exactly? You want to setup a shortcut in Alfred that’ll do a shortcut in Excel? That doesn’t make a lot of sense.

Share this post


Link to post

Sorry, I may have misled you.

It's more like I'm trying to do it on Google Sheets (I guess I said Excel because old habits die hard).

 

I'm just wondering if there was a way with alfred to look at the selected cells in Google sheets and wrap that into a formula.

 

I guess it's hard for Alfred to know what cells are actually selected.

 

 

Share this post


Link to post

What I said about Excel applies to every single application.

 

Alfred is a launcher, not an automation application. Step one is to find out if/how you can do that at all with the application. Once you have a script that does what you need, Alfred can launch it.

 

As such, you should ask on a Google forum how to automate Google Sheets.

 

Share this post


Link to post
Posted (edited)

There's no direct shortcut, but a workaround would be to use the Help Search fonction in the menu... Select the cells that you want to sum then press "Option+/" to access the Help Search menu and type "sum" and the focus would be on the "INSERT FUNCTION: SUM" function. Just press Enter and you are set.

 

This also has the benefit to easily access any menu item by name and working in other Google applications like Docs and Slides

Edited by GuiB

Share this post


Link to post

That can be automated by simulating typing with AppleScript. This script should do the trick:

tell application "System Events"
	key code 44 using option down -- OPT+/
	delay 0.5
	keystroke "sum"
	delay 0.5
	key code 36 -- Enter
end tell

Simulating keypresses, especially like this, is a last resort, however, as it just fires key events at the application without any idea if they're working.

 

You may need to increase the delays if your machine is slower (or reduce them if it's super-fast).

 

Share this post


Link to post
5 hours ago, FroZen_X said:

<.< >.> i sniff some Keyboard Maestro here....

 

Probably what I'd use, as I already own it.

 

There's no great advantage, though: you're still blindly just firing off key events in the hope that they work.

 

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×