Wrox Programmer Forums
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 29th, 2004, 07:53 AM
Registered User
 
Join Date: Jan 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Please help

Hi, can anyone please help me, I'd like to verify if cell T5 is > 500 or < -500 and if so, pop up a red msgbox that is 800x600 in size then add 1 to cell T10.

Your help would be very much appreciated

Thank you

 
Old October 29th, 2004, 09:52 AM
Authorized User
 
Join Date: Oct 2004
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to shattered Send a message via Yahoo to shattered
Default

The easiest way I guess would be to use a user form instead of a message box (that way you can control the colour, size etc).

the following code assumes you are running the macro from the page with the data on - if not amend the references to cells().value to read

sheets(Your Sheet Name Here in "").cells()

fMsgbox in this example is the custom userform.

If Cells(5, 20).Value > 500 Or Cells(5, 20).Value < -500 Then
    Cells(10, 20).Value = Cells(10, 20).Value + 1
    fMsgbox.Show
End If










Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.