LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Date Validation via Combobox in VBA

Hi,

I have created a user form to update the balanaces in the accounts.
User can pick the dates, which are user can choose by a combox box and
update accordingly.

I want to have a validation check for the date so that the user are
not allowed to pick dates which have balances already attached to
them.

I tried creating the following but its not working. I am new to VBA so
if someone can help me move in the right direction that would be
really helpful.

---------------------------------------------------

Private Sub cmblist_Change()

DateCheck

End Sub

----------------------------------------------------

Private Sub DateCheck()


If cmblist.Value < Sheets("CDN").Range("DateDBCDN") Then

' DateDBCDN is the range where the dates are posted from the user
form.

msg = "Data for this date is already posted"
Sheets("Main").Select
Range("A2").Select
dialogstyle = vbOKOnly + vbCritical
Title = "Invalid Date"
Response = MsgBox(msg, dialogstyle, Title)

End If
End Sub

-----------------------------------------------------------------------

 
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
width of ComboBox for data validation hstijnen Excel Discussion (Misc queries) 1 September 13th 07 01:57 PM
Combobox/data validation KneeDown2Up New Users to Excel 1 October 21st 06 01:55 PM
How to use validation formulas in Combobox GlenC Excel Discussion (Misc queries) 1 September 21st 06 10:19 PM
Combobox and data validation GlenC Excel Discussion (Misc queries) 2 September 13th 06 06:52 PM
data validation vs combobox paul Excel Discussion (Misc queries) 4 October 24th 05 11:42 PM


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