Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello,
I am now quite confused as to why this sub macro keeps on declaring some cell values to be exceeding 30. Basically I was given a bunch of spreadsheets that computes mileage (and a few other variables) and another spreadsheet that reads them in and creates a data file to be imported into another system. The macro I have written (and works elsewhere, please ignore the linewrap) ================================== Sub CheckMiles(sheetCurrent As Worksheet) 'checks mode for more than 30 miles in a stop. Dim bCell As Range Dim bMax As Integer Dim bMessageBox As String bMax = 30 For Each bCell In sheetCurrent.Range("O17:O46") If bCell.Value bMax Then bMessageBox = MsgBox("More than " & bMax & " in a mileage count on " & sheetCurrent.Parent.Name & ".") End If Next bCell End Sub ================================ It works if for example a computed value of say, O20 is 10.45678, but it puts out the messagebox incorrectly if O20 is 4.1234567890. Any ideas? Thanks! Amanda |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro not working correctly | Excel Discussion (Misc queries) | |||
Formula not working and I am extremely confused | Excel Worksheet Functions | |||
Formulas not working correctly | Excel Worksheet Functions | |||
SUM formula not working correctly | Excel Worksheet Functions | |||
VBE Window not working correctly | Excel Programming |