![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Apr 2002
Location: Sarasota, FL
Posts: 1,539
|
I have the option to insert an object called "Calendar Control 8.0' into my spreadsheet. Is there anyway to pull the value from this object to the sheet itself, or do I have to do it through VB. I have access to code behind the object, but I'd like to have the date go right to a cell without executing a macro.
|
|
|
|
|
|
#2 |
|
Board Regular
Join Date: Apr 2002
Location: Sarasota, FL
Posts: 1,539
|
Well I figured it out, if anyone cares, its pretty useful:
Just write this code to the worksheet with the object: Sub Calendar1_Click() Dim Period As Variant Period = Calendar1.Value Range("B6").Select ActiveCell.FormulaR1C1 = Period Range("B7").Select End Sub |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|