+ Reply to Thread
Results 1 to 6 of 6

Debug vbs code to copy and paste info from Sh1 to Sh2 triggered by selection

  1. #1
    Registered User
    Join Date
    09-22-2013
    Location
    Aurora, Colorado
    MS-Off Ver
    Excel 2007
    Posts
    30

    Debug vbs code to copy and paste info from Sh1 to Sh2 triggered by selection

    Hello: I'm trying to use vba code to copy and paste cells A and B from Sh1 to Sh2 A and B, but it is triggered when a specific selection is made on a dropdown.

    The 1st part of the code adds a hyperlink (and it works properly since I received help from this forum).

    The 2nd part is the problem, I'm trying to trigger a copy and paste event the same way (and at the same time) it is done with the hyperlink , it is triggered when a selection is made in the active sheet column K and the dropdown selection of "Cable Assy" is made. I'm trying to copy Active row cell A and B and paste them in A and B on Sh2 (sheet name: CABLE_MATRIX) into the next blank row (using cell A as a reference). Which also happens to be the same row as what the automatic hyperlink attached to.

    HTML Code: 

  2. #2
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Debug vbs code to copy and paste info from Sh1 to Sh2 triggered by selection

    Hi FlyFisherman,

    See if this works - I may have become confused along the way:

    Please Login or Register  to view this content.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  3. #3
    Registered User
    Join Date
    09-22-2013
    Location
    Aurora, Colorado
    MS-Off Ver
    Excel 2007
    Posts
    30

    Re: Debug vbs code to copy and paste info from Sh1 to Sh2 triggered by selection

    When I first make an entry in Cell A I get an error "Compile error Named argument not found" and it seems to be hung up on TextToDisplay

  4. #4
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Debug vbs code to copy and paste info from Sh1 to Sh2 triggered by selection

    Replace with:
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    09-22-2013
    Location
    Aurora, Colorado
    MS-Off Ver
    Excel 2007
    Posts
    30

    Re: Debug vbs code to copy and paste info from Sh1 to Sh2 triggered by selection

    No this doesn't work either. Can I start over? I'm wondering if I confused matters. The following code works and I hate to mess with it...because other things got messed up when I inserted your code.
    HTML Code: 
    Now disregard the code that followed this on my previous posts, if you don't mind. Can we start fresh and write new code that will do the following?

    Trigger a copy and paste event the same way (and at the same time) it is done with the hyperlink (which is the good code provided above) , it is triggered when "Cable Assy" selection is made in column K of the MAD_CAT Sheet (which is the active sheet).

    I'm trying to copy Active row cell A and B and paste them in A and B on to Sh2 (sheet name: CABLE_MATRIX) into the next blank row (using cell A as a reference). Which also happens to be the same row as what the automatic hyperlink references when "Cable Assy" selection is made.

  6. #6
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Debug vbs code to copy and paste info from Sh1 to Sh2 triggered by selection

    A sample sheet might help resolve the issue. (Go to advanced and click on the paper clip)

    Attach a sample workbook. Make sure there is just enough data to make it clear what is needed. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are demonstrated, mock them up manually if needed. Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic

+ 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. Use VBA code to copy and paste a specific selection
    By Joe Walsh in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-08-2013, 05:11 PM
  2. VBA Code to copy and paste a row depending on selection made in a combobox
    By ssu in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-20-2013, 05:37 AM
  3. [SOLVED] Cmd to Listbox (Find info in sheet2) copy/paste info to A7 Excel 2007
    By Excelnoub in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-14-2013, 09:49 AM
  4. Error on code to copy and paste user selection.
    By leaning in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-03-2011, 10:52 AM
  5. Time-Triggered Cell Copy/Paste
    By gandolff in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-01-2009, 07:04 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