+ Reply to Thread
Results 1 to 13 of 13

Copy and Paste to Worksheet using Combobox (ActiveX)

  1. #1
    Registered User
    Join Date
    10-17-2008
    Location
    Norcross, GA
    MS-Off Ver
    MS Excel 2007
    Posts
    35

    Copy and Paste to Worksheet using Combobox (ActiveX)

    Hello

    I managed to put the names of my other worksheets into some comboboxes in the main worksheet by using this code:

    Please Login or Register  to view this content.
    What I am trying to do now is this:

    If a user chooses one of the name, Cells B3:E5 of that worksheet will automatically be copied to Cells C3:F5 of the main worksheet.

    I looked at the following thread and came up with the following wrong code:

    http://www.excelforum.com/excel-prog...box-value.html

    Please Login or Register  to view this content.
    I am not too sure what to do. Any help will be greatly appreciated!
    Last edited by okriskao; 01-23-2009 at 12:21 PM.

  2. #2
    Registered User
    Join Date
    10-17-2008
    Location
    Norcross, GA
    MS-Off Ver
    MS Excel 2007
    Posts
    35
    is it not possible....? Please help! Thank you so much!

  3. #3
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,202
    Your code to populate the combobox looks a bit over complicated.

    Assuming you have the worksheet names loaded something like
    Please Login or Register  to view this content.
    Hope that helps.

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

    Free DataBaseForm example

  4. #4
    Registered User
    Join Date
    10-17-2008
    Location
    Norcross, GA
    MS-Off Ver
    MS Excel 2007
    Posts
    35
    Thank you Roy for your help! However, when I put your code in and pick a worksheet name, Excel gives me a "Subscript out of Range" Error and highlights the 2nd last line.

  5. #5
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,202
    I was just leaving from work & copied your code without noticing your ranges are wrong, replace cells with range

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    10-17-2008
    Location
    Norcross, GA
    MS-Off Ver
    MS Excel 2007
    Posts
    35
    Sorry! I tried that too and it gave the same error..

  7. #7
    Registered User
    Join Date
    10-17-2008
    Location
    Norcross, GA
    MS-Off Ver
    MS Excel 2007
    Posts
    35
    Maybe I need to change my combobox population code?

  8. #8
    Registered User
    Join Date
    10-17-2008
    Location
    Norcross, GA
    MS-Off Ver
    MS Excel 2007
    Posts
    35
    i changed the code a little to
    Please Login or Register  to view this content.

    It the error points to this
    Please Login or Register  to view this content.
    I guess something is wrong with strWs..?

  9. #9
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,202
    Can you attach your workbook?

  10. #10
    Registered User
    Join Date
    10-17-2008
    Location
    Norcross, GA
    MS-Off Ver
    MS Excel 2007
    Posts
    35
    Sorry Im trying to but I keep getting a database error

  11. #11
    Registered User
    Join Date
    10-17-2008
    Location
    Norcross, GA
    MS-Off Ver
    MS Excel 2007
    Posts
    35
    Thanks Roy so much for your help!
    Last edited by okriskao; 01-23-2009 at 12:18 PM.

  12. #12
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,202
    I can't find the code that I gave you.

    Your existing code could do with some major tidying up e.g. you don't need to select or activate the ranges you could populate the comboboxes with a loop eliminating the code for individual comboboxes

  13. #13
    Registered User
    Join Date
    10-17-2008
    Location
    Norcross, GA
    MS-Off Ver
    MS Excel 2007
    Posts
    35
    I found the reason! It should be

    Please Login or Register  to view this content.
    Last edited by okriskao; 01-23-2009 at 12:54 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