+ Reply to Thread
Results 1 to 10 of 10

Cannot assign macro to button....HELP!!!

  1. #1
    Registered User
    Join Date
    04-25-2007
    Posts
    38

    Cannot assign macro to button....HELP!!!

    This works

    Please Login or Register  to view this content.

    And this doesn't

    Please Login or Register  to view this content.

    Any ideas would be gratefully received

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Try to avoid Sendkeys. What exactly do you want to do?
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    04-25-2007
    Posts
    38
    Hi Roy

    I was trying to assign some code to a button so that it popped up with the "find" dialog box (i.e. CTRL-F), but in addition to this that it defaulted to searching the workbook and not the worksheet as would be normal...........hence the sendkeys code.

    I could use the above macro but when I assigned it to a button of any type it failed?!??!

    I then decided to forget about the button and give it a shortcut key of CTRL-F but after doing that it didn't behave as it should. Whenever I did a search using CTRL-F it would give me about 50% of the results I should have got?????

    I decided to give up on that idea as I was now in the twilight zone so I'm now looking for a neat solution to searching the whole workbook if you have any ideas????

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Ctrl F should display the Find Dialog anyway.

    This line should display the Dialog

    Please Login or Register  to view this content.
    Last edited by royUK; 08-08-2007 at 05:15 AM.

  5. #5
    Registered User
    Join Date
    04-25-2007
    Posts
    38
    Hi Roy

    Thanks but as you can see above, that's what I used....

  6. #6
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Quote Originally Posted by fry
    Hi Roy

    Thanks but as you can see above, that's what I used....
    I don't understand your problem, that line of code works.

  7. #7
    Forum Contributor
    Join Date
    08-28-2006
    Posts
    280
    fry,

    Read your line and then read Roy's line very, very carefully.

    Dean

  8. #8
    Registered User
    Join Date
    04-25-2007
    Posts
    38
    Hi Dean

    I know what you mean, mine is "value" and roys is "formula", both of which bring the find dialog box up and both of which aren't what I need.

    I might in that case say to you, "read my first post very carefully"....

  9. #9
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    You still haven't said why you need Sendkeys!

  10. #10
    Registered User
    Join Date
    04-25-2007
    Posts
    38
    Hi Roy

    It's in my post above...

    "I was trying to assign some code to a button so that it popped up with the "find" dialog box (i.e. CTRL-F), but in addition to this that it defaulted to searching the workbook and not the worksheet as would be normal...........hence the sendkeys code."

    Cheers

+ 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