ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Combobox to select date (https://www.excelbanter.com/excel-programming/359033-combobox-select-date.html)

atlantis_sweet

Combobox to select date
 

Hi,

I am new to this forum. I am new to excel VBA also. I am developing a
spreadsheet where i get inputs from the user using textboxes,comboboxes
and store it in another sheet.
Since the users can be from a different system we have different
versions of offixe (2002,2003). I want to develop a combobox to select
dates (calendar) in all the versions of office. I am not able to
proceed further and i have spent a couple of days trying to figure it.
Somebody please help me to get this coding done. Any code examples
would be good for me to get it started.

Thanks in advance


--
atlantis_sweet
------------------------------------------------------------------------
atlantis_sweet's Profile: http://www.excelforum.com/member.php...o&userid=33556
View this thread: http://www.excelforum.com/showthread...hreadid=533413


hellZg8

Combobox to select date
 
Are you using forms in VBA with these text boxes,
comboboxes to gather your data?

atlantis_sweet[_3_]

Combobox to select date
 

Yes I am using textboxes and combobox to get data from the user.
I am not sure if it is the right way. I have almost 20 fields that
will get from the user and store it in a sheet when the user hits th
submit button.

Thank

--
atlantis_swee
-----------------------------------------------------------------------
atlantis_sweet's Profile: http://www.excelforum.com/member.php...fo&userid=3355
View this thread: http://www.excelforum.com/showthread.php?threadid=53341


atlantis_sweet[_2_]

Combobox to select date
 

Yes I am using textboxes and combobox to get data from the user.
I am not sure if it is the right way. I have almost 20 fields that
will get from the user and store it in a sheet when the user hits th
submit button.

Thank

--
atlantis_swee
-----------------------------------------------------------------------
atlantis_sweet's Profile: http://www.excelforum.com/member.php...fo&userid=3355
View this thread: http://www.excelforum.com/showthread.php?threadid=53341


hellZg8

Combobox to select date
 

If you press alt + f11 this will open VBA ( Visual Basics For Applications
).Now I'm not sure if you no much about this ( I'm still learning too) anyways
In the Menu bar goto Insert then Userform here you can build a form with
text boxes, comboboxes etc..

now at first there won't be a date or calendar,but when you insert a userform
another small window will open "Toolbox" here are your comboboxes and labels
etc.

Right click in a empty area of this toolbox and a window of available
controls will pop open.Scroll down until you see either Calendar Control or
Microsoft Date And Time Picker.Select one or both,then you will see these
controls in the toolbox.

Place the Date & Time Picker Control on your userform, aLso you need to put
a command button on your userform.Doubleclick the command button and paste
the following code into it.

Then press F5 to run the form (make sure the userform is selected when you
press F5)

hope this something like what you were looking for.


Here is some code for the Date and Time Picker form Microsoft
"atlantis_sweet" wrote:


Yes I am using textboxes and combobox to get data from the user.
I am not sure if it is the right way. I have almost 20 fields that i
will get from the user and store it in a sheet when the user hits the
submit button.

Thanks


--
atlantis_sweet
------------------------------------------------------------------------
atlantis_sweet's Profile: http://www.excelforum.com/member.php...o&userid=33556
View this thread: http://www.excelforum.com/showthread...hreadid=533413



hellZg8

Combobox to select date
 
Whoops forgot to paste in the code for you well here it is

Private Sub cmdOk_Click() ' Name your command this cmdOk or
' change to what ever you would like
Nextrow = Application.WorksheetFunction.CountA(Range("A:A")) + 1
'The above row of code determines the next empty row in column A
Cells(Nextrow, 1) = DTPicker1.Value 'This enters the value form your control
Cells(Nextrow, 1).NumberFormat = "[$-409]mmmm d, yyyy;@"
'This formats for the Date
Cells(Nextrow, 1).Columns.AutoFit ' This Line autofits the column to fit
the data

Unload Me

End Sub


"atlantis_sweet" wrote:


Yes I am using textboxes and combobox to get data from the user.
I am not sure if it is the right way. I have almost 20 fields that i
will get from the user and store it in a sheet when the user hits the
submit button.

Thanks


--
atlantis_sweet
------------------------------------------------------------------------
atlantis_sweet's Profile: http://www.excelforum.com/member.php...o&userid=33556
View this thread: http://www.excelforum.com/showthread...hreadid=533413




All times are GMT +1. The time now is 04:08 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com