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: 6
Default Calculation Problem

I am using the worksheet_change event (EXCEL 97) to make
sure that the user types in numbers to no more than the
hundredths decimal place. If they type in a number like:

4.57 - entry is OK
4.572 - entry is bad

If the entry is bad I change the font to bold.

The code is as follows:

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
With Target
If Int(.Value * 100) < .Value * 100 Then
.Font.Bold = True
Else
.Font.Bold = False
End If
End With
End Sub

The code appears to work for most cases, but for certain
numbers like 2.32 and 4.56 it turns the values bold (even
though it should not). I am going NUTZ. Help would be
much 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
calculation problem Suleman[_2_] Excel Worksheet Functions 3 April 28th 08 04:11 AM
Calculation Problem slwaite Excel Discussion (Misc queries) 1 July 18th 06 07:31 PM
calculation problem les Excel Discussion (Misc queries) 1 November 24th 05 11:33 AM
Calculation Problem dave Excel Discussion (Misc queries) 0 August 24th 05 03:15 PM
Calculation Problem cvolkert Excel Discussion (Misc queries) 0 August 22nd 05 06:14 PM


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