VBA Calendar Control without Control

Ranger

New Member
Joined
Dec 22, 2002
Messages
39
A challenge for all...

Has anyone out their ever seen an Calendar type of control totally built in an Excel vba UserForm?

My problem that I’ve tried to resolve for some time is utilizing some type of pop-up calendar to eliminate format issues in my published Excel forms. I have tried a number of calendar controls but all have to be registered on the local machine and this cannot be guarantied for every machine.

If someone could direct me to a vba UserForm that has this built in that might do the trick. Or is their another way to deal with this?

Any help would be greatly appreciated.

Phil
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
This is from the archives that I found and copied some time ago, I didnt copy who posted it so sorry for no acknoweldgement.. Works a treat.
The Resulting Method
( This is the result if the VBA code and form is produced )
When you want a date in a particular cell
1- Click once on the cell where you would like date
2- Press Ctrl+d ( a calender will appear)
3- Double click on date in Calender
4- Date is entered in selected cell
5- Calender disappears

HOW TO MAKE IT HAPPEN

First: Make a VBA form
1- Open VBA editor
2- Goto VBA toolBar
3- Select "Insert" from VBA toolbar
4- Select "UserForm" from drop down menu
(you have created a userform called "userform1"

Second: Put calander on userform
1-In VBA window select the "toolbox"
2- Right click on "toolbox"
3- Select "additional controls" item from drop down menu
4- check/select "calender control" from the window that will appear
5- a calender object will appear on the "toolbox"
6- Drag and size the calender object from the "toolbox" to "userform1"

Third : Write VBA code for calender
1- Once calender is on userform1 then "double click" the calender...the VBA code window for the calender will open
2- Insert the following code

Code:
Private Sub Calendar1_DblClick()ActiveCell.Value = Calendar1.ValueUserForm1.HideUnload UserForm1End Sub



Fourth Write code to make calender appear
-1 In VBA window select "insert" from VBA toolbar
-2 From drop down menu select "Module"
-3 In the new VBA "Module" window that will appear paste the following code

Code:
Public Sub GetDate()Load UserForm1UserForm1.ShowEnd Sub



Fifth : Assign Shortcut key to Macro
-1 Close VBA window with the X in upper right corner
-2 You should now be looking at excel worksheet
-3 On excel toolbar select "Tools"
-4 From drop down menu select "Macro"
-5 From next drop down select "Macros..."
-6 From the list of macros that appear select the name "GetDate"
-7 Select the "command button " in the same window labeled "Options"
-8 Assign the shortcut key for Macro to be "Ctrl+d"
-Press OK and exit window

IT IS NOW READY FOR USE
 
Upvote 0
Thanks, but, still perplexed

Chris

The links that you provided were very helpful. I have explored these in my past research but cannot figure out how to make any of this work every time on multiple machines.

The active x controls have to registered on the resident machine or the form will have an error.

I can register the control with vba but that makes for a tricky download for the unknowing user.

Still perplexed and searching. Just short of offering a bounty…
 
Upvote 0
Re: Thanks, but, still perplexed

Ranger,

I've been searching for days now, and one lucky set of keywords in google brought me here. I'm trying to the exact same thing in the 2010 version. Have you found a way to do it yet? It's been nearly 10 years since your post, so if you have, could you tell me? Otherwise, if you're still looking, I might just join you in offering that bounty, it's driving me nuts...

Pancho
 
Upvote 0

Forum statistics

Threads
1,216,124
Messages
6,128,997
Members
449,480
Latest member
yesitisasport

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top