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: 4
Default VBA cell content check

Good afternoon,
I've got a range of cells that I'd like to (whenever one changes) run the
VBA code against. I'd like the code to check that the changed cell has a
number value (either whole or in increments of 0.25). The cell may be null -
that's an acceptible value also. If the cell is not null, nor a positive
increment of 0.25, I'd like to automate a msgbox. Then, I'd like the cell to
be highlighted (as if it's the activecell with an F2 to edit it) to give the
user the opportunity to change the value of the cell. If it's still wrong,
I'd like to have it rerun the code.

Here's what I have so far, and it does NOTHING (that I can see):

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Target.Value Then
If Target.Value 0 Then
If Target.Value < 100 Then
End If
End If
Else: MsgBox "Your cell does not contain a number. Please make the
correction."
End If
End Sub

What a) am I doing wrong, and b) do I need to do to complete my code?

All help will be greatly appreciated. Thank you!
DW
 
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
Check if content in cell is an integer prem New Users to Excel 6 May 1st 08 01:54 PM
Check if content in cell is an integer Mike H New Users to Excel 0 May 1st 08 09:53 AM
i have a check box that keeps clearing out my cells content electromag Excel Worksheet Functions 0 September 1st 06 07:56 PM
Check the content of a textbox? leonidas[_32_] Excel Programming 6 July 4th 06 09:00 AM
How to check a cell for content before running macro. Incoherent Excel Programming 1 October 7th 05 04:42 PM


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