Also can assign the value to a public variable if wanted to unload first
user form,

 

 

Regards

Rajan verma

+91 7838100659 [IM-Gtalk]

 

From: excel-macros@googlegroups.com [mailto:excel-macros@googlegroups.com]
On Behalf Of Sam Mathai Chacko
Sent: 11 May 2012 10:07
To: excel-macros@googlegroups.com
Subject: Re: $$Excel-Macros$$ Passing Values Between UserForms

 

This is one way to do it. Run UserForm1 first.

Regards
Sam Mathai Chacko

On Fri, May 11, 2012 at 3:14 PM, Shekhar Sharma <shekhar1...@gmail.com>
wrote:

Is it possible to pass Values between UserForms? If so, what's the syntax
for doing it?
Let's say I'm using this code

 

Private Sub CmdContinue_Click()
   Dim ws As Worksheet, sWCat1 As Range, sWCat2 As Range, Checker
   Set ws = Worksheets("Categories")
   Set Checker = 0
   For Each sWCat1 In ws.Range("A47:A53")
      If sWCat1.Value = "Select" Then
         MsgBox "Error 009: Weapon Skill Category Not Selected"
         Checker = 1
      End If
      For Each sWCat2 In ws.Range("A47:A53")
         If sWCat1.Value = sWCat2.Value Then
            MsgBox "Error 010: Weapon Skill Categories Cannot Be Repeated"
            Checker = 1
         End If
      Next sWCat2
      If sWCat1.Offset(0, 1).Value <> 0 Then
         Load CtrlCreate3A
         Me.Hide
         CtrlCreate3A.Show
         Checker = 1
      End If
   Next sWCat1
   If Checker <> 0 Then
      End
   Else
      Load CtrlCreate4
      Me.Hide
      CtrlCreate4.Show
      Unload Me
   End If
End Sub 

 

 

Ideally I'd like to be able to pass the value of sWCat1.Value into UserForm
CtrlCreate3A. 

-- 
Shekhar Sharma
9910010060
"Life consists not in holding good cards but in playing 
those  you hold well" 
 "Before you judge another, think of your own last mistake."

-- 
FORUM RULES (986+ members already BANNED for violation)
 
1) Use concise, accurate thread titles. Poor thread titles, like Please
Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will
not get quick attention or may not be answered.
 
2) Don't post a question in the thread of another member.
 
3) Don't post questions regarding breaking or bypassing any security
measure.
 
4) Acknowledge the responses you receive, good or bad.
 
5) Cross-promotion of, or links to, forums competitive to this forum in
signatures are prohibited. 
 
NOTE : Don't ever post personal or confidential data in a workbook. Forum
owners and members are not responsible for any loss.
 
----------------------------------------------------------------------------
--------------------------
To post to this group, send email to excel-macros@googlegroups.com




-- 
Sam Mathai Chacko

-- 
FORUM RULES (986+ members already BANNED for violation)
 
1) Use concise, accurate thread titles. Poor thread titles, like Please
Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will
not get quick attention or may not be answered.
 
2) Don't post a question in the thread of another member.
 
3) Don't post questions regarding breaking or bypassing any security
measure.
 
4) Acknowledge the responses you receive, good or bad.
 
5) Cross-promotion of, or links to, forums competitive to this forum in
signatures are prohibited. 
 
NOTE : Don't ever post personal or confidential data in a workbook. Forum
owners and members are not responsible for any loss.
 
----------------------------------------------------------------------------
--------------------------
To post to this group, send email to excel-macros@googlegroups.com

-- 
FORUM RULES (986+ members already BANNED for violation)

1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
quick attention or may not be answered.

2) Don't post a question in the thread of another member.

3) Don't post questions regarding breaking or bypassing any security measure.

4) Acknowledge the responses you receive, good or bad.

5)  Cross-promotion of, or links to, forums competitive to this forum in 
signatures are prohibited. 

NOTE  : Don't ever post personal or confidential data in a workbook. Forum 
owners and members are not responsible for any loss.

------------------------------------------------------------------------------------------------------
To post to this group, send email to excel-macros@googlegroups.com

Reply via email to