Jump to content
Macro Express Forums

Increasing A Command By One Each Subsequent Macro Pass


Recommended Posts

Hi all - first time poster, and I am fairly new to Macro Express (but I love it so far).

 

I am trying to figure out how to run commands within an Excel spreadsheet, and the goal is to have specific commands like "Enter" or "Arrow Up" increase by one with each Macro pass/repeat.  I know I can do this by copying the block of macro commands in Macro Express 500 times, and add an additional "Enter" command or "Arrow Up" command with each subsequent block of commands, but doing it this way is painful.

 

There has to be some kind of "counter" that I can use to do the below...?

 

Pass #1

<TEXTTYPE:<CTRL>c

<TEXTTYPE:<ENTER>

<TEXTTYPE:<ARROW UP>

 

Pass #2

<TEXTTYPE:<CTRL>c

<TEXTTYPE:<ENTER>

<TEXTTYPE:<ENTER>

<TEXTTYPE:<ARROW UP>

<TEXTTYPE:<ARROW UP>

 

Pass #3

<TEXTTYPE:<CTRL>c

<TEXTTYPE:<ENTER>

<TEXTTYPE:<ENTER>

<TEXTTYPE:<ENTER>

<TEXTTYPE:<ARROW UP>

<TEXTTYPE:<ARROW UP>

<TEXTTYPE:<ARROW UP>

 

...repeating the above 500+ times where "Enter" and "Arrow Up" increase by 1 each repeat.  Thanks!

Link to comment
Share on other sites

Set counter to zero

Repeat 500 times

    Add one to counter

    <TEXTTYPE:<CTRL>c

    Repeat counter times

         <TEXTTYPE:<ENTER>

    Repeat end

    Repeat counter times

          <TEXTTYPE:<ARROW UP>

    Repeat end

Repeat end

 

Watch out for timing issues -- if the macro typing gets ahead of how fast Excel can handle it, you will not be in a happy place.😞

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...
 Share

×
×
  • Create New...