ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   checkbox (https://www.excelbanter.com/excel-programming/365297-checkbox.html)

Hemant_india[_2_]

checkbox
 
hi
many a times we come across a msgbox
with check box on it labeled "do not show this msg agaon"
when we select the chek box this msg never appeared
what could be the code behind such checkbox?
please help
--
hemu

--
hemu

Mallycat[_12_]

checkbox
 

I guess it is a simple flag where the status is stored between sessions

--
Mallyca
-----------------------------------------------------------------------
Mallycat's Profile: http://www.excelforum.com/member.php...fo&userid=3551
View this thread: http://www.excelforum.com/showthread.php?threadid=55531


Hemant_india[_2_]

checkbox
 
hi mallycat
in such cases form if loaded remains with code forever?
i mean when next time i run same macro will this form appear again?
--
hemu


"Mallycat" wrote:


I guess it is a simple flag where the status is stored between sessions.


--
Mallycat
------------------------------------------------------------------------
Mallycat's Profile: http://www.excelforum.com/member.php...o&userid=35514
View this thread: http://www.excelforum.com/showthread...hreadid=555310



Gert-Jan

checkbox
 
- create a userform with the checkbox. Add this code:

Private Sub CheckBox1_Click()
Range("Sheet1!A1").Value = 1
End Sub

- Somewhere in your procedure
Sub test()
If Range("Sheet1!A1").Value = 1 Then
Exit Sub
Else
UserForm1.Show
End If
End Sub

That's it. Succes

"Hemant_india" schreef in bericht
...
hi mallycat
in such cases form if loaded remains with code forever?
i mean when next time i run same macro will this form appear again?
--
hemu


"Mallycat" wrote:


I guess it is a simple flag where the status is stored between sessions.


--
Mallycat
------------------------------------------------------------------------
Mallycat's Profile:
http://www.excelforum.com/member.php...o&userid=35514
View this thread:
http://www.excelforum.com/showthread...hreadid=555310





Gert-Jan

checkbox
 
Should be:

Private Sub CheckBox1_Change()
If CheckBox1.Value = True Then
Range("Sheet1!A1").Value = 1
Else
Range("Sheet1!A1").Value = 0
End If
End Sub

"Hemant_india" schreef in bericht
...
hi
many a times we come across a msgbox
with check box on it labeled "do not show this msg agaon"
when we select the chek box this msg never appeared
what could be the code behind such checkbox?
please help
--
hemu

--
hemu





All times are GMT +1. The time now is 08:36 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com