+ Reply to Thread
Results 1 to 7 of 7

VBA code for adding data from a UserForm in to a spreadsheet

  1. #1
    Registered User
    Join Date
    02-24-2019
    Location
    London
    MS-Off Ver
    Windows 10
    Posts
    6

    VBA code for adding data from a UserForm in to a spreadsheet

    Good morning. I have a basic User Form with 3 text box's. I want to click "Add Data" button to insert the data on to a spreadsheet. Below is what I wrote;

    Please Login or Register  to view this content.
    My spreadsheet has been saved as "DTMU Asset Log" and the line with the *********** is where I am getting an error.

    Please advise if possible, thank you.
    Last edited by davesexcel; 03-09-2019 at 05:53 AM.

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

    Re: VBA code for adding data from a UserForm in to a spreadsheet

    You have not said what the error is, I assume "Subscript out of range"?

    Check the spelling of the sheet compared to the spelling in the code.

  3. #3
    Registered User
    Join Date
    02-24-2019
    Location
    London
    MS-Off Ver
    Windows 10
    Posts
    6

    Re: VBA code for adding data from a UserForm in to a spreadsheet

    Hi sorry, you are correct with the error message. But I have checked the spelling and they are the same.

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

    Re: VBA code for adding data from a UserForm in to a spreadsheet

    There is some terminology confusion. Your original post indicates, "My spreadsheet has been saved as "DTMU Asset Log" "

    Do you mean the Workbook is saved as that name?

  5. #5
    Registered User
    Join Date
    02-24-2019
    Location
    London
    MS-Off Ver
    Windows 10
    Posts
    6

    Re: VBA code for adding data from a UserForm in to a spreadsheet

    Yes the workbook has been saved with that name.

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

    Re: VBA code for adding data from a UserForm in to a spreadsheet

    What's the sheet name?

    If you are placing data into a different workbook,
    You need the workbook name and the worksheet name

  7. #7
    Registered User
    Join Date
    02-24-2019
    Location
    London
    MS-Off Ver
    Windows 10
    Posts
    6

    Re: VBA code for adding data from a UserForm in to a spreadsheet

    Ok, so I am a complete novice....thank you for clearing that up for me! I have a question related to the code I posted, but will I need to make a new post?thank you again.

+ 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. Adding Code To The Action of A Userform Red Corner X
    By Jenn68 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 01-28-2019, 10:19 AM
  2. VBA code to retrieve information from a spreadsheet onto a userform
    By fiddly69 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-11-2015, 04:16 AM
  3. Check that the date is correct on a Userform prior to adding to spreadsheet
    By LoneWolf3574 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-28-2013, 05:42 AM
  4. Adding a sort to userform code
    By excelloser in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-21-2012, 03:30 AM
  5. Replies: 2
    Last Post: 04-06-2012, 02:42 PM
  6. Adding Code to an Existing UserForm with VBA
    By JimmyA in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-08-2010, 12:02 PM
  7. Adding code to a userform at runtime
    By mikerickson in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-27-2007, 06:19 PM

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