Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 36
Default How to retain Userform Radio Button Memory after unload

Hi all,

I have created a Userform with 3 radio options, this is called as a
subroutine within another macro, and i cannot seem to keep the memory of the
selection choice "DateFilterSelection" after it unloads.

Can anyone help me. Thank you in advance.

The code is as follows:

Private Sub OK_Click()

Dim DateFilterSelection As String

If StandardDate = True Then
DateFilterSelection = "Standard"
ElseIf BritishDate = True Then
DateFilterSelection = "British"
ElseIf AmericanDate = True Then
DateFilterSelection = "American"
End If
Unload Me

End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default How to retain Userform Radio Button Memory after unload

Move the variable declaration from sub click to a general module. Insert a
module and paste the below on top..

Public DateFilterSelection As String

If this post helps click Yes
---------------
Jacob Skaria


"swiftcode" wrote:

Hi all,

I have created a Userform with 3 radio options, this is called as a
subroutine within another macro, and i cannot seem to keep the memory of the
selection choice "DateFilterSelection" after it unloads.

Can anyone help me. Thank you in advance.

The code is as follows:

Private Sub OK_Click()

Dim DateFilterSelection As String

If StandardDate = True Then
DateFilterSelection = "Standard"
ElseIf BritishDate = True Then
DateFilterSelection = "British"
ElseIf AmericanDate = True Then
DateFilterSelection = "American"
End If
Unload Me

End Sub

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 36
Default How to retain Userform Radio Button Memory after unload

Hi Jacob,

Thanks, it works fine now.

Have a great day ahead.

Rgds
Ray

"Jacob Skaria" wrote:

Move the variable declaration from sub click to a general module. Insert a
module and paste the below on top..

Public DateFilterSelection As String

If this post helps click Yes
---------------
Jacob Skaria


"swiftcode" wrote:

Hi all,

I have created a Userform with 3 radio options, this is called as a
subroutine within another macro, and i cannot seem to keep the memory of the
selection choice "DateFilterSelection" after it unloads.

Can anyone help me. Thank you in advance.

The code is as follows:

Private Sub OK_Click()

Dim DateFilterSelection As String

If StandardDate = True Then
DateFilterSelection = "Standard"
ElseIf BritishDate = True Then
DateFilterSelection = "British"
ElseIf AmericanDate = True Then
DateFilterSelection = "American"
End If
Unload Me

End Sub

Reply
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
Retain value of userform option button Gig[_2_] Excel Programming 4 March 14th 09 06:50 PM
Excel instance won't unload from memory Editor Excel Programming 0 April 25th 07 09:40 AM
Excel instance won't unload from memory Scott B[_2_] Excel Programming 0 October 27th 06 10:26 PM
userform Radio button updates text box dok112[_7_] Excel Programming 1 June 17th 04 09:51 AM
Unload from Memory Charles Williams Excel Programming 0 July 18th 03 08:42 AM


All times are GMT +1. The time now is 05:29 PM.

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

About Us

"It's about Microsoft Excel"