Results 1 to 4 of 4

Transfer Data in Userform

Threaded View

vin1 Transfer Data in Userform 02-14-2012, 09:46 AM
OnErrorGoto0 Re: Transfer Data in Userform 02-14-2012, 09:49 AM
vin1 Re: Transfer Data in Userform 02-14-2012, 09:57 AM
JRT1712 Re: Transfer Data in Userform 02-14-2012, 09:52 AM
  1. #1
    Forum Contributor
    Join Date
    02-07-2011
    Location
    netherlands
    MS-Off Ver
    Excel 2003
    Posts
    128

    Transfer Data in Userform

    Hello i experiance some struggeling with this point.

    The main point is transfer data from 1 variable outside the userform, inside the userform.


    This is what i currently have wich wasn't so succesfull:
    
    Public M As String
    Public WS As String
    
    Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
    
    ....Other Code.....
    
     M = Month_S(C)
     WS = ActiveSheet.Name
     UserForm1.Show
    
    End Sub
    Userform:
    Private Sub UserForm_Initialize()
    
    MsgBox M
    MsgBox WS
    
    ..... Other code ......
    End sub

    In the first code is the code outside the userform. the values there are putten in M and WS correctly, but when the userform is opened it does not excist within the userform.

    Is there another way by declaring the variables outside the userform and still be able to use them inside the "Private Sub UserForm_Initialize()"?
    Last edited by vin1; 02-14-2012 at 09:58 AM.

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