Jump to content
Macro Express Forums

Layer Simple Macros In Single Macro


Ryan

Recommended Posts

Been using this software for years and have a problem that is outside my experience.  I have a macro that I need to program that moves DATA around in Excel as it gets entered.

Essentially when "1" gets entered, it needs to CONTROL+G, TYPE A1, Then CONTROL+DownArrow, then type 1+Enter.

When "2" gets entered, it needs to CONTROL+G, TYPE B1, Then CONTROL+DownArrow, then type 2+Enter.

I can program these independently but I'm sure it can be done neatly in a single macro and not use up 10 to 20 buttons.Second, is how do I nest what is essentially up to 20 triggers in the macro.

 

THANKS A MILLION For you help!

Link to comment
Share on other sites

What do you mean "when 1 gets entered"? Are you pressing the 1 key?

I can answer one of your questions. You can only assign one activation of each type to a single macro. You can only assign one hotkey at a time.

Once a macro is activated it can perform different actions depending on other information.

Link to comment
Share on other sites

Thanks for the reply Samrae.

I started to program the macro this AM. It works beautifully as individual macros, but it renders the machine utterly useless as I've highjacked all the keys.

The macro trigger is currently a single button press, in this case "1", and the next macro "2", and the next macro "3".

What I'm looking for a is a way to embed all these macros into one macro; mostly to free up the keyboard, where the macro is running and essentially listens for the input of "1" and then performs the task.

Here is my Macro for "1"
<TEXTTYPE:<CTRLD>g<CTRLU>A1<ENTER><CTRLD><ARROW DOWN><CTRLU><ARROW DOWN>1>
Here is my Macro for "2"
<TEXTTYPE:<CTRLD>g<CTRLU>C1<ENTER><CTRLD><ARROW DOWN><CTRLU><ARROW DOWN>2>

I think what I am looking for is macro this is listening for an input then performing that set of commands.

 

Link to comment
Share on other sites

To enter ‘1’ in a cell, you typically press the ‘1’ key, then ENTER or TAB or ARROW DOWN or something of the sort.  That completes the data entry and moves to another cell.  So you could try this:
1) Trigger your macro with a function key, like F1, or whatever other trigger you like (but NOT ‘1’ or ‘2’, etc.)
2) Type the value into the cell, then trigger the macro with your chosen hot key.
3) The macro types ARROW DOWN to complete the data entry and move down one cell.
4) The macro then types ARROW UP to return to the cell just entered.
5) The macro types CTRL-c to copy cell value to clipboard.
6) The macro evaluates the clipboard value, then performs the appropriate ‘1’ or ‘2’ function as you coded in your examples, depending what is in the clipboard.  All functions to be performed by the one macro, with a series of IF CLIPBOARD EQUALS tests.  If a value was entered that you don’t care about, macro doesn’t do any more typing.  

The macro is not really "listening" for the key entry as you wish, since it requires the hot key to initiate the macro after typing the value.  The only other way I can think of is to keep the individual macros as you have them, but limit their scope to Excel or to the specific spreadsheet you are working with (based on window title perhaps). 

 

Link to comment
Share on other sites

Limiting the scope is a good idea. In this case I guess that could work. It's counting USB button presses to track individual pod productivity.  So there are 20 total cells...and "1" just means pod 1 finished a unit... "2" means pod 2 finished a unit.  PLAN B could be to just do it all in excel... but organizing the data via MacroExpress makes all the fancy calculations much easier.

In a perfect world, it would just be "running" and "listening" and only performing the task once it "heard" the button press...which is essentially what I get now with individual macros and global on off control via the ME control panel.  It's just one more thing to have to teach them I guess.

 

Link to comment
Share on other sites

On 08/08/2017 at 1:46 AM, Ryan said:

Been using this software for years and have a problem that is outside my experience.  I have a macro that I need to program that moves DATA around in Excel as it gets entered.

Essentially when "1" gets entered, it needs to CONTROL+G, TYPE A1, Then CONTROL+DownArrow, then type 1+Enter.

When "2" gets entered, it needs to CONTROL+G, TYPE B1, Then CONTROL+DownArrow, then type 2+Enter.

I can program these independently but I'm sure it can be done neatly in a single macro and not use up 10 to 20 buttons.Second, is how do I nest what is essentially up to 20 triggers in the macro.

 

THANKS A MILLION For you help!

Here's an idea I wrote about several years ago which may, or may not, be helpful <g>! It's quite complex!

It is possible to write a total of 39 macros (one for each character and number, plus 3 control macros) which are fired according to which key has been pressed. Thus, pressing 3 intiates macro-3, pressing h initiates macro-h. It involves writing a total of 39 macros (most of which are almost identical)! See Detecting Keys pressed for details. But this works only in ME4.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...