+ Reply to Thread
Results 1 to 2 of 2

Can a msg box be populated via a macro variable?

  1. #1
    Registered User
    Join Date
    01-12-2009
    Location
    uk
    MS-Off Ver
    Excel 2003
    Posts
    28

    Can a msg box be populated via a macro variable?

    I have a macro that produces a value and the value is assigned to a variable i.e. myvar. Myvar does not exist on any sheet, and the value it contains exists only as a consequence of the actions of the macro. I want to display the value of myvar in a text box on a form. Do I first have to put that value in a cell on a sheet and point the text box at that cell, or can I pass that value directly to the text box? If it is possible to circumvent the need to put the value in a cell on a sheet how would I do that please.

    Many thanks for your interest and help.
    Last edited by smileyc; 04-01-2009 at 10:49 AM. Reason: to change msg box for textbox

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Can a msg box be populated via a macro variable?

    It depends how you declar the variable. If you make it a public Variable then you can use it in the UserForm.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

+ 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