Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default how to set a userform's button caption equal to a variable in the main procedure?

Hi Akh,

In a standard module, before any code, paste the fillowing code:

'=============
Option Explicit
Public strCaption As String

'---------------

Public Sub Tester()
strCaption = "Your Caption"
UserForm1.Show
End Sub
'<<=============

In the useform module, try:
'=============
Private Sub UserForm_Initialize()
Me.CommandButton1.Caption = strCaption
End Sub
'<<=============


---
Regards,
Norman



wrote in message
oups.com...
Hello--does anyone know how to set the caption on a command button of a
userform equal to a variable generated in a main procedure (in which
the userform procedure is loaded and displayed). Thanks, Abe



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
How to elegantly end a main procedure from a userform command button? [email protected] Excel Programming 1 August 2nd 06 11:54 PM
Pass switch to Main procedure Bob Phillips[_6_] Excel Programming 0 August 3rd 05 11:23 PM
label caption equal excel value Monique Excel Worksheet Functions 1 July 12th 05 07:33 PM
disable X button in main window enzomir Excel Programming 0 February 12th 05 03:51 PM
setting a range variable equal to the value of a string variable Pilgrim Excel Programming 2 July 1st 04 11:32 PM


All times are GMT +1. The time now is 07:23 AM.

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"