Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel Input box automatically rounding numbers

Status
Not open for further replies.

wildek

MIS
Mar 6, 2002
23
US
Hi,

I have an excel input box that prompts the user to enter in a person's temporary pay rate if it finds a certain code in another column. If the user enters in a pay rate with cents in it such as 40.66 or 39.50 it rounds the number off to 41 or 40. How can I get it to keep the cents and round to 2 or even 4 decimal places? I tried inserting this into the vba code prior to the input box code:

'Name column U Temp Rate and format it to 2 decimal places
Range("U1").Select
ActiveCell.FormulaR1C1 = "Temp Rate"
Columns("U:U").Select
Selection.NumberFormat = "#,##0.0000"

Thanks,
Ken
 
You probably want forum707 - VBA Visual Basic for Applications. This is VB 5 & 6.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top