+ Reply to Thread
Results 1 to 8 of 8

Trying to copy a cell range to a different worksheet based on the selection from a ListBox

  1. #1
    Registered User
    Join Date
    11-05-2013
    Location
    Arlington, TX
    MS-Off Ver
    Excel 2007
    Posts
    23

    Trying to copy a cell range to a different worksheet based on the selection from a ListBox

    I am new to VBA and need some direction on a problem. I have a listBox on sheet2 (Project Info). Based on the selection made in that ListBox, I want to copy a range of cells from sheet15 (Cust Specific Text) to a range of cells on sheet14 (ESD Safety Log). Here is what I have that doesn't work yet:

    Please Login or Register  to view this content.
    I will add code to have it try to match each of the 4 remaining available selections from the ListBox with a nested If Then Else.
    Last edited by WarrenSmiley; 11-05-2013 at 10:27 PM.

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2403 Win 11 Home 64 Bit
    Posts
    23,810

    Re: Trying to copy a cell range to a different worksheet based on the selection from a Lis

    What does this mean?
    Here is what I have that doesn't work yet:
    Did you get an error message? Tell us what it said. Which line of code was highlighted? Give us some more information to help diagnose the issue.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Registered User
    Join Date
    11-05-2013
    Location
    Arlington, TX
    MS-Off Ver
    Excel 2007
    Posts
    23

    Re: Trying to copy a cell range to a different worksheet based on the selection from a Lis

    Error message was Run-time error '438': Object doesn't support this property or method. It highlighted the If Sheets...... line of code

  4. #4
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2403 Win 11 Home 64 Bit
    Posts
    23,810

    Re: Trying to copy a cell range to a different worksheet based on the selection from a Lis

    Which line of code was highlighted when you click on the debug button?

  5. #5
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Trying to copy a cell range to a different worksheet based on the selection from a Lis

    I have a sneaking suspicion you are using a form control list box. If so give this a try:

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    11-05-2013
    Location
    Arlington, TX
    MS-Off Ver
    Excel 2007
    Posts
    23

    Re: Trying to copy a cell range to a different worksheet based on the selection from a Lis

    Now I get Run-time error '-2147024809 (80070057)':

    The item with the specific name wasn't found.

    It highlights the If ws.Shapes(.... line of code

  7. #7
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Trying to copy a cell range to a different worksheet based on the selection from a Lis

    That means either I was wrong and you are using an active x list box, or your list box is not actually called List Box 1. I would suggest you submit your workbook

  8. #8
    Registered User
    Join Date
    11-05-2013
    Location
    Arlington, TX
    MS-Off Ver
    Excel 2007
    Posts
    23

    Re: Trying to copy a cell range to a different worksheet based on the selection from a Lis

    Sorry, here is a reduced size copy of the workbook ...
    Attached Files Attached Files
    Last edited by WarrenSmiley; 12-10-2013 at 03:05 PM.

+ 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. deleting cell based off selection in listbox VBA
    By happyexcelperson in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-27-2013, 09:46 AM
  2. listbox selection based on underlying cell value
    By chrisjames25 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-26-2013, 03:04 PM
  3. [SOLVED] Copy And Paste Row Into New Worksheet Based On User Listbox Selection
    By Wings249 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-04-2012, 06:58 AM
  4. Copy cell range from another sheet based on drop down selection.
    By nhen.enry in forum Hello..Introduce yourself
    Replies: 2
    Last Post: 08-09-2012, 09:24 PM
  5. Multi select Listbox Items selection based on other Listbox item selection.
    By srinivassathi in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-20-2011, 05:53 AM

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