Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Multiple checkboxes, one macro?


Okay,

So I'm at a loss. I am trying to create a project checklist (why we
don't use MS Project is a mystery to me).

The problem is that I need to put a checkbox for each item (Row) on the
sheet, and when that checkbox is clicked I need it to time stamp the
neighboring cell. I have no problem doing it one cell at a time. The
issue is that using my current method I would have to write a macro for
each checkbox (over 500 total).

I am using the checkbox from the forms toolbar not the control toolbar.
Any suggestions?

Thanks in advance!!!


--
pkohler
------------------------------------------------------------------------
pkohler's Profile: http://www.excelforum.com/member.php...fo&userid=8919
View this thread: http://www.excelforum.com/showthread...hreadid=383862

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 111
Default Multiple checkboxes, one macro?

If your checkboxes are linked to a cell, you should be able to use a
worksheet change event for the time stamp.

--
Damon Longworth

Don't miss out on the 2005 Excel User Conference
Sept 16th and 17th
Stockyards Hotel - Ft. Worth, Texas
www.ExcelUserConference.com


"pkohler" wrote in
message ...

Okay,

So I'm at a loss. I am trying to create a project checklist (why we
don't use MS Project is a mystery to me).

The problem is that I need to put a checkbox for each item (Row) on the
sheet, and when that checkbox is clicked I need it to time stamp the
neighboring cell. I have no problem doing it one cell at a time. The
issue is that using my current method I would have to write a macro for
each checkbox (over 500 total).

I am using the checkbox from the forms toolbar not the control toolbar.
Any suggestions?

Thanks in advance!!!


--
pkohler
------------------------------------------------------------------------
pkohler's Profile:
http://www.excelforum.com/member.php...fo&userid=8919
View this thread: http://www.excelforum.com/showthread...hreadid=383862



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 93
Default Multiple checkboxes, one macro?

What about to use cells in column A as "buttons":

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Intersect(Target, Me.Range("a2:a500")) Is Nothing Then 'a2:a500
- the button cells
If Cells(ActiveCell.Row, 2).Value = "" Then
Cells(ActiveCell.Row, 2).Value = Now()
End If
End If
End Sub

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Multiple checkboxes, one macro?


May be you could program your macro using a "For each.....Next loop"

I don't know how is your sheet but let me know if any help is neede
for the programming

S

--
Sibili
-----------------------------------------------------------------------
Sibilia's Profile: http://www.excelforum.com/member.php...fo&userid=2136
View this thread: http://www.excelforum.com/showthread.php?threadid=38386

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,758
Default Multiple checkboxes, one macro?

You can use the same macro if you use the checkbox from the forms toolbar:

Option Explicit
Sub CBXClick()

Dim myCBX As CheckBox

Set myCBX = ActiveSheet.CheckBoxes(Application.Caller)
If myCBX.Value = xlOn Then
With myCBX.TopLeftCell.Offset(0, 1)
.Value = Now
.NumberFormat = "mm/dd/yyyy hh:mm:ss"
End With

End If

End Sub

===
And if you want to add those checkboxes (500 is a lot) via a macro, this may
help.

Option Explicit
Sub addCBX()
Dim myCBX As CheckBox
Dim myRng As Range
Dim myCell As Range

With ActiveSheet
.CheckBoxes.Delete 'nice for testing

Set myRng = .Range("a1:a" & .Cells(.Rows.Count, "C").End(xlUp).Row)

For Each myCell In myRng.Cells
With myCell
Set myCBX = .Parent.CheckBoxes.Add _
(Top:=.Top, Width:=.Width, _
Left:=.Left, Height:=.Height)
With myCBX
.LinkedCell = myCell.Address(external:=True)
.Caption = "" 'or whatever you want
.Name = "CBX_" & myCell.Address(0, 0)
If myCell.Address = myRng.Cells(1).Address Then
.OnAction = "CBXClick"
End If
End With
.NumberFormat = ";;;"
End With
Next myCell
End With
End Sub



pkohler wrote:

Okay,

So I'm at a loss. I am trying to create a project checklist (why we
don't use MS Project is a mystery to me).

The problem is that I need to put a checkbox for each item (Row) on the
sheet, and when that checkbox is clicked I need it to time stamp the
neighboring cell. I have no problem doing it one cell at a time. The
issue is that using my current method I would have to write a macro for
each checkbox (over 500 total).

I am using the checkbox from the forms toolbar not the control toolbar.
Any suggestions?

Thanks in advance!!!

--
pkohler
------------------------------------------------------------------------
pkohler's Profile: http://www.excelforum.com/member.php...fo&userid=8919
View this thread: http://www.excelforum.com/showthread...hreadid=383862


--

Dave Peterson


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
Multiple checkboxes and aligning Dudedad Excel Discussion (Misc queries) 2 June 26th 07 07:28 PM
Multiple Checkboxes Annie Excel Discussion (Misc queries) 2 June 11th 07 05:06 PM
Adding multiple checkboxes timmeah4 Excel Discussion (Misc queries) 7 December 6th 06 02:48 PM
Multiple Checkboxes Shortcut? Jason Excel Discussion (Misc queries) 1 October 18th 05 08:08 PM
Multiple checkboxes 1 macro George J Excel Programming 6 October 15th 03 04:50 PM


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