Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Multiple checkboxes and aligning | Excel Discussion (Misc queries) | |||
Multiple Checkboxes | Excel Discussion (Misc queries) | |||
Adding multiple checkboxes | Excel Discussion (Misc queries) | |||
Multiple Checkboxes Shortcut? | Excel Discussion (Misc queries) | |||
Multiple checkboxes 1 macro | Excel Programming |