+ Reply to Thread
Results 1 to 14 of 14

Submitting date from one sheet to another

  1. #1
    Registered User
    Join Date
    03-16-2020
    Location
    Manchester
    MS-Off Ver
    2016
    Posts
    4

    Submitting date from one sheet to another

    Good Morning

    I am currently in the middle of trying to submit data from one excel sheet to anothewr, adding the data to seperate rows. This is the current VBA code that im using:

    Please Login or Register  to view this content.
    Current Setup of my workbook looks like this:

    Capture11.JPG
    Capture12.JPG

    Im wanting the data that is input on the first image, to be copied into the sepate page, without overwriting any other data that has been submitted.

    I am encountering an error

    "Run Time-Error"9""
    Subscript out of range

    Any help on how to solve this would be great.

    Regards
    Last edited by DingaBell; 03-16-2020 at 08:52 AM.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,464

    Re: Macro Not Working - Submitting date from one sheet to another

    Looks like the only thing that could give you a subscript out of range Error is the output tab name. Could there be a trailing space on the tab name? I'd be inclined to qualify the input ranges with the sheet name, for example, Sheets("Home").Range("H10").Value
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Arrow Re: Macro Not Working - Submitting date from one sheet to another


    Hi,

    with an attachment it may be achieved just using a single codeline …

  4. #4
    Registered User
    Join Date
    03-16-2020
    Location
    Manchester
    MS-Off Ver
    2016
    Posts
    4
    Hello Marc

    I’m unsure as to what you mean?

  5. #5
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Arrow Re: Macro Not Working - Submitting date from one sheet to another


    See top page yellow banner …

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,464

    Re: Macro Not Working - Submitting date from one sheet to another

    Please don't change the original post ... it completely screws the context of subsequent responses.

    If you're going to change the code to something else that doesn't work, do it in a separate post.


    Please attach a sample workbook (not a picture or pasted copy). Make sure there is just enough data to demonstrate your need. 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 shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.

  7. #7
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,464

    Re: Macro Not Working - Submitting date from one sheet to another

    Looks like you spelt ws_output wrong. See: ws_ouput = "TestD" and ws_ouput = "Data"

    Use Option Explicit to check for missed or misspelt variable names.

    Both these versions work

    Please Login or Register  to view this content.
    And ...

    Please Login or Register  to view this content.

  8. #8
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,528

    Re: Macro Not Working - Submitting date from one sheet to another

    Change references, Sheet names etc, where required.
    Please Login or Register  to view this content.

  9. #9
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,464

    Re: Macro Not Working - Submitting date from one sheet to another

    @jolivanes: the input cells are in alternate rows ...

  10. #10
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,528

    Re: Macro Not Working - Submitting date from one sheet to another

    @TMS
    Thanks. Missed that one completely. Might be doable with SpecialCells.

  11. #11
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,464

    Re: Macro Not Working - Submitting date from one sheet to another

    Might be doable with SpecialCells
    Had a try but I can't get it to work.

    Here's my sample workbook to play with.
    Attached Files Attached Files

  12. #12
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,528

    Re: Macro Not Working - Submitting date from one sheet to another

    I am out of the door. Happy Hour is calling.
    Should work with copy and paste special.

    Please Login or Register  to view this content.
    Last edited by jolivanes; 03-16-2020 at 07:15 PM.

  13. #13
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,528

    Re: Macro Not Working - Submitting date from one sheet to another

    For ease of maintenace, changes if required, following is my preference for this kind of a problem
    Please Login or Register  to view this content.

  14. #14
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,464

    Re: Submitting date from one sheet to another

    @DingaBell: you now have four versions that all appear to give the correct results plus an explanation of the root cause of the problem. Also, by referencing the Home sheet specifically, the code will work whatever sheet is selected (if you run it manually, not from the button.

    Is this now resolved


    If you are satisfied with the solution(s) provided, please mark your thread as Solved.


    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save


    You may also want to consider thanking those people who helped you by clicking on the little star at the bottom left of their reply to your question.

+ 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. Replies: 0
    Last Post: 10-19-2016, 11:37 AM
  2. how can i show hide my sheet will submitting my data
    By baig123 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-03-2014, 02:49 AM
  3. Putting Spreadsheet Into Date Order After Submitting Userform
    By stuu3270 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-05-2013, 08:38 AM
  4. Display before submitting
    By kryt0n in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-06-2010, 11:25 AM
  5. submitting new rows
    By kryt0n in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-23-2010, 06:59 AM
  6. Generating numbers & submitting details from one sheet to another
    By Meenakshi Sood in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 02-09-2006, 02:57 PM
  7. [SOLVED] Error on submitting an Excel Sheet using Outlook
    By AccessHelp in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-01-2005, 10:40 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