Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default reset checkboxes

Hi,

I would like to know how to reset a check box (It is from the forms
toolbar). At the moment; the checkbox calls a macro:

Sub Checkbox4_Click()
WFState = 1
'ActiveSheet.checkbox4.Value = False
End Sub

The ActiveSheet.checkbox4.Value does not work for some reason!!

--------------------

I have a "Ok" pushbutton, when then does the following

Sub AddNextActions_Click()
Dim sheetName As String

If WFState = 1 Then
sheetName = "Waiting-For"
WFState = 0
Else
sheetName = "Next-Actions"
End If

NewRow = Worksheets(sheetName).Range("B65536").End(xlUp).Ro w + 1

Worksheets(sheetName).Cells(NewRow, 2).Value =
Worksheets("Dashboard").Range("L13").Value
Worksheets("Dashboard").Range("L13").Value = ""

End Sub

-------------------------

Now ideally I would not want to even have the "Checkbox4_Click()"
routine, but would rather like to check the status in the

If WFState = 1 part here. Moreover, I also want to reset the Checkbox
as soon as I have decided which sheet to update.


Cheers

karthik

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default reset checkboxes

This works for me

Sub Checkbox4_Click()
WFState = 1
ActiveSheet.CheckBoxes("CheckBox4").Value = False
End Sub

but it is odd code, if they set it, you un set it?

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"karthik" wrote in message
ups.com...
Hi,

I would like to know how to reset a check box (It is from the forms
toolbar). At the moment; the checkbox calls a macro:

Sub Checkbox4_Click()
WFState = 1
'ActiveSheet.checkbox4.Value = False
End Sub

The ActiveSheet.checkbox4.Value does not work for some reason!!

--------------------

I have a "Ok" pushbutton, when then does the following

Sub AddNextActions_Click()
Dim sheetName As String

If WFState = 1 Then
sheetName = "Waiting-For"
WFState = 0
Else
sheetName = "Next-Actions"
End If

NewRow = Worksheets(sheetName).Range("B65536").End(xlUp).Ro w + 1

Worksheets(sheetName).Cells(NewRow, 2).Value =
Worksheets("Dashboard").Range("L13").Value
Worksheets("Dashboard").Range("L13").Value = ""

End Sub

-------------------------

Now ideally I would not want to even have the "Checkbox4_Click()"
routine, but would rather like to check the status in the

If WFState = 1 part here. Moreover, I also want to reset the Checkbox
as soon as I have decided which sheet to update.


Cheers

karthik



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default reset checkboxes

Hi Bob,

This is what I am trying to do. I want to update a certain worksheet
if I have the check box clicked and another one if I dont have it
clicked. I am not a VB guy, in fact I am just a couple of hours old in
VB. I am totally not sure if this is the best way to do it too!! :)



Bob Phillips wrote:
This works for me

Sub Checkbox4_Click()
WFState = 1
ActiveSheet.CheckBoxes("CheckBox4").Value = False
End Sub


I get the error

Unable to get checkboxes property of the worksheet class!


warm regards

karthik












(there's no email, no snail mail, but somewhere should be gmail in my addy)

"karthik" wrote in message
ups.com...
Hi,

I would like to know how to reset a check box (It is from the forms
toolbar). At the moment; the checkbox calls a macro:

Sub Checkbox4_Click()
WFState = 1
'ActiveSheet.checkbox4.Value = False
End Sub

The ActiveSheet.checkbox4.Value does not work for some reason!!

--------------------

I have a "Ok" pushbutton, when then does the following

Sub AddNextActions_Click()
Dim sheetName As String

If WFState = 1 Then
sheetName = "Waiting-For"
WFState = 0
Else
sheetName = "Next-Actions"
End If

NewRow = Worksheets(sheetName).Range("B65536").End(xlUp).Ro w + 1

Worksheets(sheetName).Cells(NewRow, 2).Value =
Worksheets("Dashboard").Range("L13").Value
Worksheets("Dashboard").Range("L13").Value = ""

End Sub

-------------------------

Now ideally I would not want to even have the "Checkbox4_Click()"
routine, but would rather like to check the status in the

If WFState = 1 part here. Moreover, I also want to reset the Checkbox
as soon as I have decided which sheet to update.


Cheers

karthik


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default reset checkboxes

So why are you doing it in the click event. Just check it directly in your
macro

If Activesheet.Checkboxes("CheckBox4") Then
'do one thing
Else
'do another
End If

BTW, did you rename the checkbox? On my system, the forms CBs tend to take a
name of the form Check Box 1, etc.

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"karthik" wrote in message
ups.com...
Hi Bob,

This is what I am trying to do. I want to update a certain worksheet
if I have the check box clicked and another one if I dont have it
clicked. I am not a VB guy, in fact I am just a couple of hours old in
VB. I am totally not sure if this is the best way to do it too!! :)



Bob Phillips wrote:
This works for me

Sub Checkbox4_Click()
WFState = 1
ActiveSheet.CheckBoxes("CheckBox4").Value = False
End Sub


I get the error

Unable to get checkboxes property of the worksheet class!


warm regards

karthik












(there's no email, no snail mail, but somewhere should be gmail in my
addy)

"karthik" wrote in message
ups.com...
Hi,

I would like to know how to reset a check box (It is from the forms
toolbar). At the moment; the checkbox calls a macro:

Sub Checkbox4_Click()
WFState = 1
'ActiveSheet.checkbox4.Value = False
End Sub

The ActiveSheet.checkbox4.Value does not work for some reason!!

--------------------

I have a "Ok" pushbutton, when then does the following

Sub AddNextActions_Click()
Dim sheetName As String

If WFState = 1 Then
sheetName = "Waiting-For"
WFState = 0
Else
sheetName = "Next-Actions"
End If

NewRow = Worksheets(sheetName).Range("B65536").End(xlUp).Ro w + 1

Worksheets(sheetName).Cells(NewRow, 2).Value =
Worksheets("Dashboard").Range("L13").Value
Worksheets("Dashboard").Range("L13").Value = ""

End Sub

-------------------------

Now ideally I would not want to even have the "Checkbox4_Click()"
routine, but would rather like to check the status in the

If WFState = 1 part here. Moreover, I also want to reset the Checkbox
as soon as I have decided which sheet to update.


Cheers

karthik




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default reset checkboxes

Hi,

I have now removed the click event, now the macro looks like this

Sub AddNextActions_Click()

Dim sheetName As String

If ActiveSheet.CheckBoxes("Waiting For") Then
sheetName = "Waiting-For"
ActiveSheet.CheckBoxes("Waiting For").Value = False
Else
sheetName = "Next-Actions"
End If

End Sub

I have called the checkbox "Waiting For", but I get the runtime error
1004 -- Unable to get Checkbox property of worksheet class !!

Should I initialize something somewhere!!

warm regards

karthik


Bob Phillips wrote:
So why are you doing it in the click event. Just check it directly in your
macro

If Activesheet.Checkboxes("CheckBox4") Then
'do one thing
Else
'do another
End If

BTW, did you rename the checkbox? On my system, the forms CBs tend to take a
name of the form Check Box 1, etc.

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"karthik" wrote in message
ups.com...
Hi Bob,

This is what I am trying to do. I want to update a certain worksheet
if I have the check box clicked and another one if I dont have it
clicked. I am not a VB guy, in fact I am just a couple of hours old in
VB. I am totally not sure if this is the best way to do it too!! :)



Bob Phillips wrote:
This works for me

Sub Checkbox4_Click()
WFState = 1
ActiveSheet.CheckBoxes("CheckBox4").Value = False
End Sub


I get the error

Unable to get checkboxes property of the worksheet class!


warm regards

karthik












(there's no email, no snail mail, but somewhere should be gmail in my
addy)

"karthik" wrote in message
ups.com...
Hi,

I would like to know how to reset a check box (It is from the forms
toolbar). At the moment; the checkbox calls a macro:

Sub Checkbox4_Click()
WFState = 1
'ActiveSheet.checkbox4.Value = False
End Sub

The ActiveSheet.checkbox4.Value does not work for some reason!!

--------------------

I have a "Ok" pushbutton, when then does the following

Sub AddNextActions_Click()
Dim sheetName As String

If WFState = 1 Then
sheetName = "Waiting-For"
WFState = 0
Else
sheetName = "Next-Actions"
End If

NewRow = Worksheets(sheetName).Range("B65536").End(xlUp).Ro w + 1

Worksheets(sheetName).Cells(NewRow, 2).Value =
Worksheets("Dashboard").Range("L13").Value
Worksheets("Dashboard").Range("L13").Value = ""

End Sub

-------------------------

Now ideally I would not want to even have the "Checkbox4_Click()"
routine, but would rather like to check the status in the

If WFState = 1 part here. Moreover, I also want to reset the Checkbox
as soon as I have decided which sheet to update.


Cheers

karthik





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default reset checkboxes

Hi Bob,

It worked,

thanks

warm regards

karthik
karthik wrote:
Hi,

I have now removed the click event, now the macro looks like this

Sub AddNextActions_Click()

Dim sheetName As String

If ActiveSheet.CheckBoxes("Waiting For") Then
sheetName = "Waiting-For"
ActiveSheet.CheckBoxes("Waiting For").Value = False
Else
sheetName = "Next-Actions"
End If

End Sub

I have called the checkbox "Waiting For", but I get the runtime error
1004 -- Unable to get Checkbox property of worksheet class !!

Should I initialize something somewhere!!

warm regards

karthik


Bob Phillips wrote:
So why are you doing it in the click event. Just check it directly in your
macro

If Activesheet.Checkboxes("CheckBox4") Then
'do one thing
Else
'do another
End If

BTW, did you rename the checkbox? On my system, the forms CBs tend to take a
name of the form Check Box 1, etc.

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"karthik" wrote in message
ups.com...
Hi Bob,

This is what I am trying to do. I want to update a certain worksheet
if I have the check box clicked and another one if I dont have it
clicked. I am not a VB guy, in fact I am just a couple of hours old in
VB. I am totally not sure if this is the best way to do it too!! :)



Bob Phillips wrote:
This works for me

Sub Checkbox4_Click()
WFState = 1
ActiveSheet.CheckBoxes("CheckBox4").Value = False
End Sub

I get the error

Unable to get checkboxes property of the worksheet class!

warm regards

karthik












(there's no email, no snail mail, but somewhere should be gmail in my
addy)

"karthik" wrote in message
ups.com...
Hi,

I would like to know how to reset a check box (It is from the forms
toolbar). At the moment; the checkbox calls a macro:

Sub Checkbox4_Click()
WFState = 1
'ActiveSheet.checkbox4.Value = False
End Sub

The ActiveSheet.checkbox4.Value does not work for some reason!!

--------------------

I have a "Ok" pushbutton, when then does the following

Sub AddNextActions_Click()
Dim sheetName As String

If WFState = 1 Then
sheetName = "Waiting-For"
WFState = 0
Else
sheetName = "Next-Actions"
End If

NewRow = Worksheets(sheetName).Range("B65536").End(xlUp).Ro w + 1

Worksheets(sheetName).Cells(NewRow, 2).Value =
Worksheets("Dashboard").Range("L13").Value
Worksheets("Dashboard").Range("L13").Value = ""

End Sub

-------------------------

Now ideally I would not want to even have the "Checkbox4_Click()"
routine, but would rather like to check the status in the

If WFState = 1 part here. Moreover, I also want to reset the Checkbox
as soon as I have decided which sheet to update.


Cheers

karthik



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
reset ALL checkboxes (created with control toolbar) with the click of ONE BUTTON [email protected] Excel Programming 1 July 7th 07 07:27 PM
Using Checkboxes Freddy Excel Programming 4 December 26th 06 07:02 PM
CheckBoxes: How to reset Rob Excel Discussion (Misc queries) 9 September 8th 06 04:25 AM
How to reset checkboxes from control tool box? [email protected] Excel Programming 11 August 24th 06 08:13 PM
Reset Checkboxes from Control Tool Box Robert Excel Programming 7 August 22nd 06 05:36 AM


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