+ Reply to Thread
Results 1 to 6 of 6

A problem about "SENDKEYS"...

  1. #1
    Registered User
    Join Date
    09-13-2009
    Location
    China
    MS-Off Ver
    Excel 2007
    Posts
    15

    Exclamation A problem about "SENDKEYS"...

    wt.zip

    I tried to use "sendkeys" for inserting "sum" formula to cell "A7",but it's failed.
    Someone can give suggestion ? Thanks!

    (I just want to simulate "ALT =" combination keys)

    Sub test()
    [a7].Select
    Application.SendKeys ("%=")
    End Sub

  2. #2
    Forum Contributor
    Join Date
    10-30-2013
    Location
    Melbourne
    MS-Off Ver
    Excel 2013
    Posts
    173

    Re: A problem about "SENDKEYS"...

    Yes, I have a suggestion. Don't ever use SendKeys. It's buggy as...


    Sent from my iPad using Tapatalk

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    38,842

    Re: A problem about "SENDKEYS"...

    Why not use
    Please Login or Register  to view this content.

    Regards, TMS
    Trevor Shuttleworth - Excel Aid

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  4. #4
    Registered User
    Join Date
    09-13-2009
    Location
    China
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: A problem about "SENDKEYS"...

    i got it and just interested in it. Thanks!

  5. #5
    Registered User
    Join Date
    09-13-2009
    Location
    China
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: A problem about "SENDKEYS"...

    Thanks!

    In worksheet,using "Alt"+"=" will insert formula which sum the top continous cells ( cells count are dynamic).
    This is useful .So i tried to simulate this in VBA.

    Is there familiar methord? Thanks!

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    38,842

    Re: A problem about "SENDKEYS"...

    The following is a very simplistic simulation of what Alt-= does.

    Please Login or Register  to view this content.

    With AutoSum (Alt-=), if there are no populated cells in the column or row of the Active Cell, you will simply get the formula =SUM() and have to select a range. If there are no populated cells above the Active Cell, it will SUM all the cells to the left. Otherwise it will SUM the cells above it.

    I did consider trying to go for the full emulation but it's more complicated than it looks. Unfortunately, there are just too many considerations.

    Regards, TMS

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Trying to Highlight Data using SendKeys "+{LEFT}"
    By athyeh in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-24-2014, 11:26 AM
  2. Replies: 4
    Last Post: 11-17-2013, 12:05 PM
  3. SendKeys "{ENTER}" in Macro...............Permission denied
    By BHD in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-30-2013, 06:26 PM
  4. [SOLVED] Why doesn't "Sendkeys" work reliably for me?
    By Cloudfall in forum Excel General
    Replies: 2
    Last Post: 09-26-2005, 02:05 AM
  5. [SOLVED] changing a SendKeys "(^+{home})" to a function
    By filo666 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-12-2005, 07:07 PM

Tags for this Thread

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