Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default SIMPLE UserForm w/ 2 OPTION BUTTONS


I am a somewhat newbie to VBA. How would you add constants for strin
values?
Chuckles12

--
Chuckles12
-----------------------------------------------------------------------
Chuckles123's Profile: http://www.excelforum.com/member.php...fo&userid=1494
View this thread: http://www.excelforum.com/showthread.php?threadid=26805

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default SIMPLE UserForm w/ 2 OPTION BUTTONS

For your code I would do something like

Public Const sOption1 As String = "EVAL"
Public Const sOption2 As String = "BID"

Public Button As String
Sub CREATE_FORM()
'
frmPricing.Show
'SHOW Pricing UserForm ON DISPLAY

'USER SELECTS BUTTON

'AFTER SELECTION, CONTROL COMES BACK HERE
If Button = sOption1 Then
Range("A1").Select

ElseIf ton = sOption2 Then
Range("C1").Select

Else
Msgbox "Error in selection"

End If

End Sub

'BELOW IS CODE FOR EACH OF 2 OPTION BUTTONS

Private Sub optEVAL_Prices_Click()
Button = sOption1
Unload Me
End Sub

Private Sub optBID_Prices_Click()
Button = sOptions2
Unload Me
End Sub


--

HTH

RP

"Chuckles123" wrote in message
...

I am a somewhat newbie to VBA. How would you add constants for string
values?
Chuckles123


--
Chuckles123
------------------------------------------------------------------------
Chuckles123's Profile:

http://www.excelforum.com/member.php...o&userid=14948
View this thread: http://www.excelforum.com/showthread...hreadid=268057



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default SIMPLE UserForm w/ 2 OPTION BUTTONS

Const sSTRING as String = "ABCD"

--
Regards,
Tom Ogilvy


"Chuckles123" wrote in message
...

I am a somewhat newbie to VBA. How would you add constants for string
values?
Chuckles123


--
Chuckles123
------------------------------------------------------------------------
Chuckles123's Profile:

http://www.excelforum.com/member.php...o&userid=14948
View this thread: http://www.excelforum.com/showthread...hreadid=268057



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
Option Buttons/Radio Buttons John Calder New Users to Excel 7 May 16th 08 03:51 AM
option buttons neilb514 New Users to Excel 0 December 9th 07 09:28 PM
option buttons help kb Excel Worksheet Functions 2 June 18th 07 11:06 PM
SIMPLE UserForm w/ 2 OPTION BUTTONS Chuckles123[_38_] Excel Programming 1 October 11th 04 09:03 AM
Option Buttons Alan Excel Programming 1 January 8th 04 05:55 PM


All times are GMT +1. The time now is 03:59 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"