Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Common routine to handle a check box

I have a checkbox on a userform, and in a procedure I want to

make the checkbox invisible and
set it to false

Sub blob(x As CheckBox)
x.Visible = False
x = False
End Sub

So I have the above routine, but when am I calling it, how do I call
blob
blob(checkbox1) doesn't work because it's pass the value in I think
which is a boolean, and not of type checkbox
--
Mike
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Common routine to handle a check box

Here is an example

Private Sub CommandButton1_Click()
blob Me.CheckBox1
End Sub

Private Sub blob(cb As MSForms.CheckBox)
MsgBox cb.Name
End Sub

This passes the object, not just one property, so you can access those
properties from within blob.

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Mike News" wrote in message
...
I have a checkbox on a userform, and in a procedure I want to

make the checkbox invisible and
set it to false

Sub blob(x As CheckBox)
x.Visible = False
x = False
End Sub

So I have the above routine, but when am I calling it, how do I call
blob
blob(checkbox1) doesn't work because it's pass the value in I think
which is a boolean, and not of type checkbox
--
Mike



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Common routine to handle a check box

On Tue, 21 Feb 2006 at 00:16:21, Bob Phillips (Bob Phillips
) wrote:
Here is an example

Private Sub CommandButton1_Click()
blob Me.CheckBox1
End Sub

Private Sub blob(cb As MSForms.CheckBox)
MsgBox cb.Name
End Sub

This passes the object, not just one property, so you can access those
properties from within blob.

Thanks. I'd read about using Me from within the event on a checkbox,
but thought that referred to the object and not the whole userform

Many thanks
--
Mike
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Common routine to handle a check box

Me generally refers to the containing object, so it is the Userform in
userform code module, the worksheet in that sheet code module, and the
workbook in ThisWorkbook.

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Mike News" wrote in message
...
On Tue, 21 Feb 2006 at 00:16:21, Bob Phillips (Bob Phillips
) wrote:
Here is an example

Private Sub CommandButton1_Click()
blob Me.CheckBox1
End Sub

Private Sub blob(cb As MSForms.CheckBox)
MsgBox cb.Name
End Sub

This passes the object, not just one property, so you can access those
properties from within blob.

Thanks. I'd read about using Me from within the event on a checkbox,
but thought that referred to the object and not the whole userform

Many thanks
--
Mike



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
Calculating a Check Digit Routine rojobrown Excel Worksheet Functions 4 October 29th 09 10:58 PM
Combining two ranges based on common a common value ahmed[_3_] Excel Discussion (Misc queries) 5 April 18th 09 05:04 PM
how can I check the current owner of the file stored in a common D INRIDisciples Excel Discussion (Misc queries) 0 November 28th 07 02:07 PM
Fill handle turned into a move handle Northwoods Excel Discussion (Misc queries) 1 March 2nd 07 03:40 PM


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