+ Reply to Thread
Results 1 to 11 of 11

vba coding... IF, Then, Goto "multi workbooks"

  1. #1
    Registered User
    Join Date
    11-23-2009
    Location
    home
    MS-Off Ver
    Excel 2007
    Posts
    6

    Question vba coding... IF, Then, Goto "multi workbooks"

    i need help with this if statement.
    i want excel to look at what text is in the combo box on my user form, depending on what it is i want it to move me to another workbook and a specific sheet within that workbook.

    the code i have tried myself is...

    Please Login or Register  to view this content.

    I nned this for my a level project so if you can get back to me asap i would be grateful.
    Cheers
    Last edited by Domintor2992; 11-25-2009 at 10:46 AM. Reason: forum rules

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,525

    Re: vba coding... IF, Then, Goto "multi workbooks"

    Does it work?
    Replace the "else" with "Elseif", then you would only require one "End If"
    You may need to dim the workbook, at the beggining

    Untested.

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    11-23-2009
    Location
    home
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: vba coding... IF, Then, Goto "multi workbooks"

    thanks for your attempt but when i copied your code into my spreadsheets and ran the user form, the button that this action is supposed to occur on didnt do anything.

  4. #4
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,525

    Re: vba coding... IF, Then, Goto "multi workbooks"

    Quote Originally Posted by Domintor2992 View Post
    thanks for your attempt but when i copied your code into my spreadsheets and ran the user form, the button that this action is supposed to occur on didnt do anything.
    I believe you need to the word "Application"

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    11-23-2009
    Location
    home
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: vba coding... IF, Then, Goto "multi workbooks"

    didnt work... still does nothing when i click the button... this is what my code looks like now

    Code:

    Please Login or Register  to view this content.
    sorry if thats not in the code box thing, i dont know how to put it in
    Last edited by davesexcel; 11-24-2009 at 08:16 AM. Reason: You cannot use quick reply if you are submitting code, because the code icon "#" is not in quick reply

  6. #6
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,525

    Re: vba coding... IF, Then, Goto "multi workbooks"

    You can Attach the two workbooks, so we can get this to work.

    I am surprised that you have been able to make a UserForm and work with VBA Code, yet you are unable to read the Forum Rules and figure out how to wrap VBA code in your posts.

  7. #7
    Registered User
    Join Date
    11-23-2009
    Location
    home
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: vba coding... IF, Then, Goto "multi workbooks"

    hey ive just read the rules for the forum, didnt realise it would be so strict but never mind its helpful so i will follow them...

    and according to excel the 2 workbooks are already linked.

  8. #8
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,525

    Re: vba coding... IF, Then, Goto "multi workbooks"

    Quote Originally Posted by Domintor2992 View Post
    hey ive just read the rules for the forum, didnt realise it would be so strict but never mind its helpful so i will follow them...

    and according to excel the 2 workbooks are already linked.
    I meant to attach the two workbooks to your post, so somebody can see what the problem is.

  9. #9
    Registered User
    Join Date
    11-23-2009
    Location
    home
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: vba coding... IF, Then, Goto "multi workbooks"


  10. #10
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,525

    Re: vba coding... IF, Then, Goto "multi workbooks"

    Please Login or Register  to view this content.
    This is in the combo box Old Trafford Guided Tour (Manchester) They don't match,

    Most of what is in the code and the ComboBox do not match.

    Another issue could be that Worksheets is spelled wrong in every line

  11. #11
    Registered User
    Join Date
    11-23-2009
    Location
    home
    MS-Off Ver
    Excel 2007
    Posts
    6

    Talking Re: vba coding... IF, Then, Goto "multi workbooks"

    Solved.. thank you for your help... the last thing you suggested made it work.

    all working perfect now

    Cheers
    Dom

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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