Results 1 to 7 of 7

User Form Basics - Populating Text Boxes

Threaded View

  1. #1
    Registered User
    Join Date
    07-06-2009
    Location
    NH, USA
    MS-Off Ver
    2010 & 2013
    Posts
    38

    Question User Form Basics - Populating Text Boxes

    If anybody has a link to a good tutorial on user forms, it would be greatly appreciated. Failing that...

    I am trying to create a user form to edit some named ranges. The VBA user form designer is basically the same as Borland Delphi, so building the form itself was easy. What I can't figure out is how to populate the user form with the data from the spreadsheet.

    I have a number of text boxes on the form with names like txtTier1Slots, txtTier1Ceiling, txtTier1Floor, etc up to 4.

    I have a defined name that corresponds with each item, Tier1Slots, Tier1Ceiling, Tier1Floor, and so on. I'm using defined names because they're referenced in Conditional Formatting on one of the worksheets in my project. They don't exist as actual cells, just name references.

    I want to get the form populated with those values. I've tried about twenty variations of the following code, using ThisWorkbook, Workbooks, Cells, Range, Name, and just about every cell reference method I can think of. I've so many different error messages, my head is spinning.

    Private Sub UserForm_Initialize()
        frmRaceLimits.txtTier1Slots.Value = ActiveWorkbook.Cells("intTier1Slots").Value
    End Sub
    Any thoughts?
    Last edited by T.J. Lanza; 09-23-2009 at 02:58 PM. Reason: Problem solved, though I still have how/why questions.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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