+ Reply to Thread
Results 1 to 3 of 3

Userform Not writing to second worksheet

  1. #1
    Registered User
    Join Date
    02-10-2018
    Location
    toronto ontario
    MS-Off Ver
    office 2010
    Posts
    66

    Userform Not writing to second worksheet

    Hello Everyone

    I am having a problem trying to get a combo box (CboLoc)and a text box(txtJobNum) to save data to a second work sheet
    the CboLoc uses a list range to pull data form sheet called JobDB and populate the CboLoc and txtJobNum this works Ok
    But if I enter a new name in CboLoc and number in txtJobNum it will not find the first blank row or write it to the JobDb sheet

    Every thing works till this point in my code With ThisWorkbook.Sheets("JobDB")

    Below is my code so far

    Please Login or Register  to view this content.
    Thanks for any help on this
    Attached Files Attached Files
    Last edited by mmikem; 11-28-2019 at 04:40 PM. Reason: adding file

  2. #2
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Userform Not writing to second worksheet

    Hello mmikem,

    We would be much better off trying to help you if we knew where the Code is placed. In the Userform or a Sheet.

    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.

    Regards.
    Please consider:

    Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .

  3. #3
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: Userform Not writing to second worksheet

    Hi mmikem,

    Try the following code. Your choice of syntax while correct, makes the code difficult to read and maintain.

    In the UserForm Code Module:
    Please Login or Register  to view this content.
    In an ordinary code module (easier to debug when not in the UserForm code module):
    Please Login or Register  to view this content.
    To prevent typos from ruining days and weeks of work 'Option Explicit' is NEEDED at the top of each code module. This prevents errors caused by missspellings and FORCES every variable to be DECLARED (e.g. Dim i as Integer). https://www.excel-easy.com/vba/examp...-explicit.html

    Lewis

+ 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. [SOLVED] Userform Entries not writing To Sheet
    By liquidmettle in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-21-2015, 02:24 PM
  2. Writing data from userform to different rows
    By bqheng in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 09-09-2015, 08:20 PM
  3. Userform text box persists in writing US date format to worksheet
    By Aestivator1 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 06-04-2015, 03:45 PM
  4. Writing data from excel worksheet back to the same row through VBA userform
    By Jakeyboy in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-13-2014, 08:01 PM
  5. [SOLVED] Writing from Userform and matching values
    By giant in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-09-2013, 05:39 AM
  6. [SOLVED] VBA code for writing to worksheet with userform
    By steviebhoy66 in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 07-09-2013, 01:15 PM
  7. [SOLVED] userform not writing to sheet
    By cfinch100 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-06-2013, 01:14 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