+ Reply to Thread
Results 1 to 10 of 10

How do I bring a value into a Userform field?

  1. #1
    Registered User
    Join Date
    10-15-2017
    Location
    kanata, ontario, canada
    MS-Off Ver
    MS 365
    Posts
    37

    How do I bring a value into a Userform field?

    Create a Userform with fields to track data of any kind.

    2 sheets inside same workbook
    - Sheet 1 - PartsData - database of data
    - Sheet 2 - Menu that I'm working with

    Clcik on Part Data Entry sheet
    Click on Add Part Information. Msgbox will show the first empty row in the PartsData sheet
    Then the form is displayed
    I wanted to display the value number of the row that is empty in the form.

    Click on close to close the Userform.

    I've attached the file - PartsLocDB-02.xlsm

    This is where I`m stuck. Can anyone help. Greatly appreciated.
    Attached Files Attached Files

  2. #2
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: How do I bring a value into a Userform field?

    Without looking at the file I would say that the moment you have selected a part the data is displayed sheetx.cells(x,y).value the same way you can sheetx.cells(x,y).row for the row or sheetx.cells(x,y).column for the column
    ---
    Hans
    "IT" Always crosses your path!
    May the (vba) code be with you... if it isn't; start debugging!
    If you like my answer, Click the * below to say thank-you

  3. #3
    Registered User
    Join Date
    10-15-2017
    Location
    kanata, ontario, canada
    MS-Off Ver
    MS 365
    Posts
    37

    Re: How do I bring a value into a Userform field?

    Hi Hans

    So, would that be coding that I put in a field in the Userform (and if so, what property?), or outside, and if outside, I'm guessing that it would be put before I load the Userform.

    the data value is from sheet1, and I would like to display that data value in the Userform from sheet2
    (I hope that it`s clear what I`m trying to do.)

  4. #4
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: How do I bring a value into a Userform field?

    The moment the form opens you can display the active cell row, and yes add a filed or you could even add it as a control tip text the shows up when you hover over the parts Id field
    Your file throws an error due to missing control file, I think you use this dll for the date picker (I hate those things) so cannot really test it or for.
    When form is initialized and you know the empty row you can add the controltip text some tile Me.TextBox.ControlTipText=activecell.row

  5. #5
    Registered User
    Join Date
    10-15-2017
    Location
    kanata, ontario, canada
    MS-Off Ver
    MS 365
    Posts
    37

    Re: How do I bring a value into a Userform field?

    Updated the form to remove the calendar option.

    still not getting what I need to do.

    Can you try to open the file and see what I'm trying to do

    the msgbox will display the last empty row, which is what I'm trying to bring into the userform

    thank you
    Attached Files Attached Files

  6. #6
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: How do I bring a value into a Userform field?

    I'm off to a meeting, won't be back 'till later this afternoon, will take a look then.

  7. #7
    Registered User
    Join Date
    10-15-2017
    Location
    kanata, ontario, canada
    MS-Off Ver
    MS 365
    Posts
    37

    Re: How do I bring a value into a Userform field?

    Thanks Keebellah

  8. #8
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: How do I bring a value into a Userform field?

    Add this code to the search form vba

    Please Login or Register  to view this content.

  9. #9
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: How do I bring a value into a Userform field?

    I would however suggest that you replace the txtSearch box with a listbox or combobox that way you see the parts ID, the rest of the code would still work
    Last edited by Keebellah; 10-20-2017 at 03:22 AM. Reason: info

  10. #10
    Registered User
    Join Date
    10-15-2017
    Location
    kanata, ontario, canada
    MS-Off Ver
    MS 365
    Posts
    37

    Re: How do I bring a value into a Userform field?

    Hi Keebellah

    It works. Thank you very much for your help.

    Greatly appreciated.

+ 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. Inserting worksheet doesn't bring Userform
    By bentod in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-03-2016, 01:33 PM
  2. error VBA script trying to bring userform data from different then active sheet
    By archangel9999 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-02-2014, 04:34 AM
  3. How to bring second worksheets data in Userform ListBox2 ?
    By z-eighty2 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-08-2014, 02:12 PM
  4. [SOLVED] Copy Data loaded via Userform to a worksheet named in 1 field of the Userform
    By audax48 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-15-2012, 01:44 PM
  5. Open Cell Link(Bring to Front) with CommandButton on Userform
    By bdb1974 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-07-2011, 10:45 AM
  6. Double clicking the results in Listview to bring up another userform
    By vbanew in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-22-2011, 04:29 AM
  7. bring up a userform that searches
    By shilpz in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-19-2008, 09:48 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