Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Help with Check Box and VBA

Hi,

I am new to excel and I am not sure if what I want is doable or not,
would really appreciate your help;

I want to create a two columns sheet in the first column I want a chec
box in the next column a date field. When the user checks the check bo
the current date and time would be put in the date column this way
can tell when that task was done. If the check mark is unchecked th
second cell needs to be cleared out if a date was there already.

If you can help me with both how to create the check box and how t
attach the code to it to do the above it will be great.

Thanks

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Help with Check Box and VBA

Hi,

Here is a solution that doesn't use a checkbox, but does put a check mark in
the column. Just copy the code into the worksheet code module (right-click
on the sheet name tab, select View Code, and paste the code in). Try it!

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

With Target
If .Column = 1 Then
If .Value = "a" Then
.Value = ""
.Font.Name = "Arial"
.Offset(0, 1).Value = ""
Else
.Value = "a"
.Font.Name = "Marlett"
.Offset(0, 1).Value = Format(Date, "dd mmm yyyy")
End If
.Offset(0, 1).Activate
End If
End With
End Sub

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"wlatif " wrote in message
...
Hi,

I am new to excel and I am not sure if what I want is doable or not, I
would really appreciate your help;

I want to create a two columns sheet in the first column I want a check
box in the next column a date field. When the user checks the check box
the current date and time would be put in the date column this way I
can tell when that task was done. If the check mark is unchecked the
second cell needs to be cleared out if a date was there already.

If you can help me with both how to create the check box and how to
attach the code to it to do the above it will be great.

Thanks.


---
Message posted from http://www.ExcelForum.com/



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
make a check form, and then have info go to a check register richie g Excel Worksheet Functions 0 May 5th 10 12:10 AM
Copy and move check box (check boxes) with new cell link? Marty Excel Worksheet Functions 1 January 20th 10 07:43 PM
Increase size of a Forms Check Box (click on to enter check mark) 718Satoshi Excel Discussion (Misc queries) 0 August 17th 07 01:52 AM
Check if Conditional Format is True or False / Check cell Color Kevin McCartney Excel Worksheet Functions 5 June 29th 07 11:12 AM
Enable check box in protected sheet + group check boxes Dexxterr Excel Discussion (Misc queries) 4 August 2nd 06 12:00 PM


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