+ Reply to Thread
Results 1 to 2 of 2

Using data value form one VBA excel one useform to other

  1. #1
    Registered User
    Join Date
    03-30-2020
    Location
    Mumbai
    MS-Off Ver
    365 ProPlus
    Posts
    1

    Using data value form one VBA excel one useform to other

    Need help!
    I want use data value of userform1 in userform2. I know syntax to refer useform1 data in userform2. But after running userform1, userform2 pops successfully. And then entering data in useform2, it doesn't calculate output of userform2.
    So I get error "Run time error 424".

  2. #2
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    Office 365 ProPlus
    Posts
    5,621

    Re: Using data value form one VBA excel one useform to other

    I'd recommend uploading sample workbook.

    But in general, rather than accessing object value directly from another form. I'd suggest using global/public variable to store value and pass that on to subsequent process.

    Ex: In standard module at top line declare global variable (variant or specific type).
    Then in Userform1, assign value to that variable from some object's value (note that Textbox will always have string type value, regardless of type of value stored, in case of numeric values use CLng or CDbl function to convert). Then use that variable in your Userform2 as desired.

    See link for more about variable scope.
    https://www.excel-easy.com/vba/examp...ble-scope.html
    “Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something.”
    ― Robert A. Heinlein

+ 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. How to create useform in excel VBA to search and display data on same form?
    By yjames in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-03-2018, 04:18 AM
  2. [SOLVED] Useform to Popup; When I click on a Name Range In Excel
    By Rajeshkumar R in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 12-20-2016, 04:53 AM
  3. Adding a textbox to a useform upon clicking on a button in the useform.
    By jakopak in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-29-2016, 08:16 AM
  4. Useform search and copy data
    By amador in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-09-2014, 11:56 AM
  5. [SOLVED] Useform to transfer data to two seperate workbooks
    By wmolitor in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-12-2014, 11:01 AM
  6. VBA data entry Useform help
    By sa.1985 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-25-2012, 04:03 AM
  7. [SOLVED] Excel: useform and shapes
    By Greg in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-16-2006, 01:45 PM

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