[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Excel VBA Rounding Up

Posted on 2011-03-01
4
Medium Priority
?
195 Views
Last Modified: 2012-05-11
Hello Experts,

I have amended some of the code provided by an expert to alert when a certain value is reached in a cell, basically its:

For Each xCell In Range("O2:O" & xLastRow)
    xValue = xCell.Value
    If Not IsError(xValue) Then
        If xValue <> "" And xValue = 0.0002 Then
            PlayTheSound "Windows XP Print complete.wav"
            Cells(1, 15).Interior.Color = 255
            Point02 = True
            Exit For
        End If
    End If
Next

I would like a sound when xValue = 0.0002 (0.02%)

Originally it was < 0.0002

However, I think because I'm after an exact number its not alerting. So my guess is I think it needs to be rounded.

I have attached the spreadsheet to illustrate. The cells in question are in column O

I should mention that I have conditionally formatted the column to highlight when the value goes below < 0.0002. But as I mentioned, I would just like a sound alert when the actual value is reached.

The sound has been taken care of by Chris (another expert). I now just need it to be activated when 0.0002 is actually reached.

I hope my explanation isn't to convoluted.

Cheers


Trade-Day--10-Experts-1-.xlsm
0
Comment
Question by:cpatte7372
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 85

Accepted Solution

by:
Rory Archibald earned 2000 total points
ID: 35009560
Something like:
 If Application.ROund(val(xValue),4) = 0.0002 Then

Open in new window

0
 

Author Comment

by:cpatte7372
ID: 35011597
rorya

Thanks for responding. I will check it out....
0
 
LVL 24

Expert Comment

by:Tracy
ID: 35356955
This question has been classified as abandoned and is being closed as part of the Cleanup Program. See my comment at the end of the question for more details.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question