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: 81
Default UserForm Control references as variable

Excel 2003
On my UserForm I have several CommandButtons.
In my code, I want to refer to a selected or active one as a variable,
rather than by it's name, say CommandButton4.
So I store it's name:-
Worksheets("MyVariables").Range("A4")=UserForm1.Ac tiveControl.Name (which
works ok)
and instead of UserForm1.CommandButton4.BackColor = .................
I would like to do:-
UserForm1.Worksheets("MyVariables").Range("A4").Ba ckColor =
..................
which doesn't work, as the synyax or method is wrong.
Can it be done and if so how.


 
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 variable values to userform control KJ-clueless Excel Discussion (Misc queries) 2 November 27th 07 10:51 PM
Selecting control on userform with part of control name (set question) Keith Excel Programming 4 January 10th 07 02:24 PM
Control Sequence from Userform Control Nigel Excel Programming 3 December 29th 04 01:25 PM
Problem with references to OCX control Senapathy Excel Programming 0 July 20th 04 11:12 AM
External data references in a userform control jmikerea[_3_] Excel Programming 2 July 17th 04 01:11 PM


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