+ Reply to Thread
Results 1 to 3 of 3

Consecutive Sendkeys commands won't work

  1. #1
    Registered User
    Join Date
    09-25-2015
    Location
    New Jersey, USA
    MS-Off Ver
    2013
    Posts
    3

    Angry Consecutive Sendkeys commands won't work

    I have created a complex program to help teach people to play the pedal steel guitar. It's pretty cool.
    Now, I am trying to automate parts of it, but I am not a VBA guy, but very good with EXCEL as a whole.
    What I am trying to do is run a macro that will go to a cell, activate the drop down, move down one item on the list (the drop down contains a "data validation" list of items, and then press the enter key or whatever is necessary to activate new setting.

    Here is my first shot at vba code, and I am frustrated as heck, because it works down to the getting the drop down to work,
    Please Login or Register  to view this content.
    but the second Sendkeys command wont' execute.
    Please Login or Register  to view this content.
    As you can see, I have put in a wait statement to help. (it doesn't) but without the wait statement I don't even get the drop down box to work.

    I have tested the Sendkeys command, and it works multiple times (like going to a cell, and moving down a couple cells) but the code seems to stop after the Alt Down command.

    Seems simple enough, what is THE PROBLEM????

    Here is my complete code from the macro. Thanks much for helping.

    Please Login or Register  to view this content.
    Last edited by JBeaucaire; 09-25-2015 at 08:36 PM. Reason: Added missing CODE tags. Please read and follow the Forum Rules, link above in the menu bar. Thanks.

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,623

    Re: Consecutive Sendkeys commands won't work

    Hi,

    Why at all use sendkeys? This is "last resort" tool.

    My proposition is that you shall read current A37 value, locate it on a list, select next entry from the list and write it to A37.

    First thread which showed looking on how to get current position on validation list was: http://stackoverflow.com/questions/8...-dropdown-list
    Best Regards,

    Kaper

  3. #3
    Registered User
    Join Date
    09-25-2015
    Location
    New Jersey, USA
    MS-Off Ver
    2013
    Posts
    3

    Question Re: Consecutive Sendkeys commands won't work

    Hi Kaper. Thanks very much for the reply and trying to help.

    I don't know if you solution will work. The text that I am trying to select from the pick list is any one of eight variables, which tells one formula what chord to select. The result of that formula, is used as a variable in another program. As I said, this is all a part of a fairly complicated excel program, and not just "i need this number". Maybe what you are suggesting can work, but let me tell you what is happening.

    A quick example is a cmajor scale. If you were playing the single notes, they are C,D,E,F,G,A,B,C.
    D for example is the D second degree of the scale, E is the third degree, etc. But a scale can also be played harmonized, utilizing the chords that fall into that scale. (based on scale type, (Major, Minor, etc..) If your a musician, you might know this stuff.. it's music theory, if you do, please excuse my restating it.

    So, a Cmajor scale, chorded (or "harmonized" , is
    C Major D Minor E Minor F Major G Major A Minor B Diminished C Major.

    My program will display those chords, telling a person how and where to play them on the pedal steel. So to do that, I have to know the notes that are involved in those chords.

    I have everything working fine in the program. I can pick the scale, (in this case C, and the Scale type, in this case "Major", and the "degree" I want, First through Eighth (that's the pick list) and program returns the correct chord. So If I pick "Third" from the drop down, I am returned an E Minor chord. Ok so far.

    I want my macro to move from third to fourth, by pressing a button, (or first to second, second to third, whatever). While using my program, a person will have finger picks on, so typing is an issue. But he could click the "Advance Scale Degree" button, and continue his practicing/playing.

    When you pick second, it feeds that variable into this formula, to find the starting note of the chord.
    =VLOOKUP($B$39,onlynotesarray,HLOOKUP($D$39,SCALEDEGREES,4,FALSE),FALSE) This returns the value "E", the starting note of the third degree scale chord.
    Then, there are two more formulas that look up the notes, for that scale type , and that starting note.

    =IF($D$39="major_",VLOOKUP(I27,onlynotesarray,HLOOKUP("minor",allchordtypes,3,FALSE),FALSE),IF($D$39="Minor_",VLOOKUP(I27,onlynotesarray,HLOOKUP("Major_Chord",allchordtypes,3,FALSE),FALSE),IF($D$39="Harmonic_Minor",VLOOKUP(I27,onlynotesarray,HLOOKUP("AUG",allchordtypes,3,FALSE),FALSE),IF($D$39="Melodic_Minor",VLOOKUP(I$27,onlynotesarray,HLOOKUP("Aug",allchordtypes,3,FALSE),FALSE),IF($D$39="Augmented",VLOOKUP(I27,onlynotesarray,HLOOKUP("Blues_7th",allchordtypes,3,FALSE),FALSE))))))

    This formula evaluates the second note I need, which happens to be the value "G".

    As you can see, I have some pretty complicated stuff here.
    I don't know how I can incorporate you solution into this mechanism.

    ??
    Thanks Again.

+ 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. [SOLVED] why doesn't SendKeys work consistently?
    By crimsonkng in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-13-2022, 12:58 AM
  2. I Can't get SHOWDATAFORM and sendkeys to work together?
    By jegentry in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-03-2014, 03:52 AM
  3. Sendkeys doesn't work on my laptop with Vista
    By foxguy in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-26-2010, 07:24 PM
  4. MIN & MAX VBA commands not seeming to work
    By Danexcel in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-08-2009, 03:40 PM
  5. [SOLVED] excel training--some of the commands do not work/some do
    By Anthony Brancaccio in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 06-29-2006, 09:40 PM
  6. Application.SendKeys won't work with Remote Desktop????
    By WildIrish in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-10-2005, 11:06 AM
  7. [SOLVED] List of commands that work with shell?
    By quartz in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-16-2005, 11:06 AM

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