LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 65
Default passing values from form to module

Hello, all.

I have a programming issue I can’t seem to get a handle on.

I have an application that launches a form (“LaunchForm”) that gives
the user a choice of picking either Radio Button A or B. Picking
either radio button assigns a string variable (“textvariable”) with an
appropriate value (StringA or StringB).

When I try to pass textvariable from the form to the application, it
disappears. Any suggestions? Here’s the basic code:


Option Explicit

Sub RunThisApp()

LaunchForm.Show

Range(“A1”).Value = textvariable

.........more code.....

Unload LaunchForm

End Sub

Here’s the code for LaunchForm

Option Explicit
Public textvariable As String ' I added the public statement to
the form since this is the first appearance of textvariable

Private Sub YesButton_Click()

If ButtonA.Value = True Then
textvariable = "StringA"
End If

If ButtonB.Value = True Then
textvariable = "StringB”
End If

LaunchForm.hide

End Sub

Private Sub CancelButton_Click()
Unload LaunchForm
Exit Sub
End Sub


Art
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Passing Form Values David Excel Programming 6 October 2nd 07 07:33 PM
Passing Module to subroutine SixSigmaGuy[_2_] Excel Programming 2 April 25th 06 10:59 PM
Passing arrays to VBA module Ralph K Excel Programming 1 November 20th 04 02:57 PM
Passing Strings from UserForm to Module John Kauffman Excel Programming 3 May 28th 04 05:01 PM
Passing variables from module to userform Chris Dunigan Excel Programming 4 November 26th 03 09:37 AM


All times are GMT +1. The time now is 02:59 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"