+ Reply to Thread
Results 1 to 3 of 3

Alternatives to SenKeys and OnKey in VBA/Macros

  1. #1
    Registered User
    Join Date
    11-05-2012
    Location
    Palmer, Alaska
    MS-Off Ver
    Office for Mac, Windows 7 & Windows 7 Parallels
    Posts
    17

    Alternatives to SenKeys and OnKey in VBA/Macros

    I've read some opinions online, saying that whenever somebody is using SendKeys there is usually a better way to obtain their objective. I'm interested in the alternatives; I use Excel for Mac at home (which doesn't recognize SendKeys) and would like to learn some work-arounds. Here's a relevant example of what I'm talking about:
    Please Login or Register  to view this content.
    Tab_Enter is the macro that runs when I hit tab, and it works fine in MS Excel. The macro is simply ActiveCell.Offset(1,0).Select, so essentially the tab key functions like the enter key In a particular row that I specified in VBA.

    In another worksheet, I'm using SendKeys "+{ }" which selects the entire row of the ActiveCell. Perhaps there is some Applescript approach to solving my problem, but I'm also interested in some more robust VBA language that I can progress with. Thanks in advance for your time and attention.

  2. #2
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Alternatives to SenKeys and OnKey in VBA/Macros

    Please Login or Register  to view this content.
    though I don't know why you would want to do that in code?
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  3. #3
    Registered User
    Join Date
    11-05-2012
    Location
    Palmer, Alaska
    MS-Off Ver
    Office for Mac, Windows 7 & Windows 7 Parallels
    Posts
    17

    Re: Alternatives to SenKeys and OnKey in VBA/Macros

    Perhaps it is unnecessary. I'm fairly new to VBA and the more I learn the more simplified everything gets. I'm sure you're right and I'm just taking too many steps in my code. Any suggestions on changing Tab Key behavior in a specific row without using OnKey?

    Thanks for the help, by the way.

    On a closer look, entirerow doesn't yield exactly the same result as shift+space, unless my target cell is in the first column to begin with. hmm...
    Last edited by #Justin!; 12-05-2012 at 02:36 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1