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

I am trying to create a macro that would enter todays date (hard coded) on
the date that a checkbox was checked. The cell would be offset by two
columns in the same row as the checkbox. Please advise.

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 60
Default Insert Date with Check Box

....I guess I should also add that I have more than 50 checkboxes in this
worksheet.

"ToddEZ" wrote:

I am trying to create a macro that would enter todays date (hard coded) on
the date that a checkbox was checked. The cell would be offset by two
columns in the same row as the checkbox. Please advise.

Thanks

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Insert Date with Check Box

Add a checkbox from the Forms toolbar and assign this macro to it.

Option Explicit
Sub TestMe()
dim myCBX as Checkbox
set myCBX = activesheet.checkboxes(application.caller)

mycbx.topleftcell.offset(0,2).value = date
end sub

or maybe:

Option Explicit
Sub TestMe()
dim myCBX as Checkbox
set myCBX = activesheet.checkboxes(application.caller)

if mycbx.value = xlon then
mycbx.topleftcell.offset(0,2).value = date
else
mycbx.topleftcell.offset(0,2).value = ""
end if
end sub

Change the name (TestMe) to something that makes more sense to you.

And then copy this checkbox 49 times.

The assigned macro will "travel" with the copied checkbox.

ToddEZ wrote:

I am trying to create a macro that would enter todays date (hard coded) on
the date that a checkbox was checked. The cell would be offset by two
columns in the same row as the checkbox. Please advise.

Thanks


--

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
How can I insert a date with an icon (calendar) insert Alfredo Mederico[_2_] Excel Discussion (Misc queries) 4 September 21st 07 01:20 AM
how do i insert a check box into excell 07 Jay Excel Discussion (Misc queries) 1 April 19th 07 04:15 PM
Check Values/Insert Rows Dan R. Excel Programming 2 March 27th 07 11:36 PM
How can I check a cell for current date and insert it if blank? Don K New Users to Excel 3 September 29th 06 02:46 PM
check for insert row action... mark kubicki Excel Programming 0 May 26th 06 01:07 AM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"