Results 1 to 3 of 3

User Forms Basics - Text Boxes to Named Range

Threaded View

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

    Question User Forms Basics - Text Boxes to Named Range

    So, first time with user form user (redundant much?). I got some help yesterday over in this thread: User Form Basics - Populating Text Boxes. A few tweaks later and its reading the data just fine. Some of the specific form objects and range names have changed, but it's the same logic.

    Anyway, this isn't just for display. I need to export the data back to the spreadsheet. So, I plugged this line into the event handler for the "Save & Exit" button on the sample form in the other thread:

    Range("intTier1Size").Value = frmRaceLimits.txtTier1Size
    Excel responds with...

    Run-time error '1004':
    Method 'Range' of object '_Global' failed
    If I change the code to read:

    Range("H5").Value = frmRaceLimits.txtTier1Size
    It dumps the value in the cell H5 on the current worksheet.

    As before, the named ranges are not cell references. Some are static values, some are formulas. They don't exist anywhere except the Name Manager. To make it more confusing, I've used Range with similar named ranges in quite a few other procedures, and it works just fine. Only here, where it involves a user form, do I have a problem.

    Any thoughts?
    Last edited by T.J. Lanza; 09-24-2009 at 03:36 PM. Reason: Solved! royUK is a genius.

Thread Information

Users Browsing this Thread

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

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