Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default VB calculations

Tim,

See code snippets in-line.

HTH,
Bernie
MS Excel MVP


"timmulla" wrote in message
...
Can anyone help me do the following calculations in a excel userform.

I have two calendar 10.0 controls (Calendar1 and Calendar2).
Calendar1.value relates to a start date and calendar2.value relates to an end
date. I'm trying to have the number of days between Calendar1 and Calendar2
show up in a conrtol labeledTextBox8, when Commandbutton1 is clicked.


Depends: something like:

Userform1.TextBox8.Text = Userform1.Calendar2.value - Userform1.Calendar1.Value
Userform1.TextBox8.Text = Userform1.Calendar2.value - Userform1.Calendar1.Value + 1

TextBox1 - Numerical user input expressed as a percentage (i.e. 10%,this is
a % fee charged on an account).

TextBox2 - Numerical user input expressed a dollar amount (i.e. $100,000,
this is account value).

TextBox3 - I'm trying to have the value of TextBox1.value * Texbox2.value
show up when Commandbutton1 is clicked.


UserForm1.TextBox3.Text = _
Format(Val(UserForm1.TextBox1.Text) / 100 * _
Val(UserForm1.TextBox2.Text), "00.00")


TextBox4 - I'm trying to have TextBox3.value/365 show up when Commandbutton1
is clicked (This will give me a daily rate).



UserForm1.TextBox4.Text = _
Format(Val(UserForm1.TextBox3.Text) / 365, "00.00")

TextBox5 - I'm trying to have TextBox8.value * TextBox5.value show up when
Commandbutton1 is clicked.


UserForm1.TextBox5.Text = _
Format(Val(UserForm1.TextBox8.Text) * _
Val(UserForm1.TextBox5.Text), "00.00")

Though be careful with this one... multiple clicks will give you problems.



Reply
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
MPG Calculations Terry Bennett Excel Worksheet Functions 8 June 10th 08 10:17 PM
age calculations Tulip Excel Discussion (Misc queries) 2 July 8th 07 07:29 PM
#N/A in calculations JonR Excel Worksheet Functions 6 September 10th 06 07:33 PM
Help with calculations Scoooter Excel Worksheet Functions 1 June 19th 06 03:19 PM
! in Calculations Strata Excel Discussion (Misc queries) 4 December 14th 05 01:15 PM


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

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"