+ Reply to Thread
Results 1 to 4 of 4

Userform data carry over

  1. #1
    Registered User
    Join Date
    06-16-2012
    Location
    Englewood ,Fl
    MS-Off Ver
    2007
    Posts
    7

    Userform data carry over

    i am trying to create a user form to pull info an populate a worksheet using data from a different worksheet. it is based on a particular month and a date. when run the user formand it opens the other work book i need it to use the month in conjuction with some other stuff to select the proper worksheet and then a date entered to find the proper row to pull data from. However soon as it opens and switches to the new workbook it looses the data entry from the userform. I am running a sub routine outside of the userform to pull and transfer the data. forgive me if this is an easy issue i am only minimally skilled and learnign from doing and searchign the web for information.

    the line of code i am using is :

    Worksheet.Select = Txtmonth.Value + " outbound flint"

    i is going good to this point but the txtmonth.value has no value so i get runtime errors

  2. #2
    Valued Forum Contributor StevenM's Avatar
    Join Date
    03-23-2008
    Location
    New Lenox, IL USA
    MS-Off Ver
    2007
    Posts
    910

    Re: Userform data carry over

    There are a number of different ways of returning values from a userform. In my opinion, the easiest method is to create public variables in your standard module. Then inside your userform code, give these public variables value.

    For example, at the top of your standard module you can have:

    Please Login or Register  to view this content.
    Then somewhere in your userform code you can add a value to dt:

    For example:
    Please Login or Register  to view this content.
    Then when you close the userform, dt will still contain a value.

  3. #3
    Registered User
    Join Date
    06-16-2012
    Location
    Englewood ,Fl
    MS-Off Ver
    2007
    Posts
    7

    Re: Userform data carry over

    Thank you but i solved the issue differently. Instead of using a different sub routine in a module i added it to the userform code. I should have thought of that before asking here i guess. The help was appreciated though

  4. #4
    Valued Forum Contributor StevenM's Avatar
    Join Date
    03-23-2008
    Location
    New Lenox, IL USA
    MS-Off Ver
    2007
    Posts
    910

    Re: Userform data carry over

    Actually, I like that option also, especially if it is just a small amount of code. But if you have a large amount of code to follow, I don't know if you really want to put it all in the userform module. But that is just my opinion.

+ Reply to Thread

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