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: 93
Default Date Calculation in UserForm TextBox

I am making a form to receive certain loan parameters and then
calculate certain other parameters. According to our rules, if
the close date is 12/02/2003-01/01/2004, the First Payment Date
is on 02/01/2004, and so on for every month. For some reason,
the first day of each month is an odd-ball, but so be it.
I came up with a spreadsheet formula that gives the correct
first payment date for all close dates.
=IF(DAY(B16)=1,DATE(YEAR(B16),(MONTH(B16)+1),(DAY( B16)-DAY(B16)+1)),
DATE(YEAR(B16),(MONTH(B16)+2), (DAY(B16)-DAY(B16)+1)))
where B16 is any close date.
What I need to do is convert this into VBA code for a text box
value after the close date is entered in another text box.
At present, that is accomplished by the following.

Public Sub UserForm_Activate()
txtCloseDate.Value = Format(Now(), "mmmm d, yyyy")
Any help would be appreciated.
 
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
Date Format for Userform TextBox John Calder New Users to Excel 4 July 29th 09 10:19 PM
Need A date Mask format for a Textbox on UserForm [email protected] Excel Discussion (Misc queries) 2 November 4th 07 02:27 AM
userform textbox Phil Excel Worksheet Functions 5 January 16th 05 06:59 PM
Userform Textbox - Date Problem universal[_6_] Excel Programming 2 November 26th 03 04:31 PM
UserForm TextBox to ActiveSheet TextBox over 256 characters Dan E[_2_] Excel Programming 1 July 28th 03 07:36 PM


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