Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 440
Default Message box warning of missing data

Hi,
When a user inputs data (numbers) into cells in column D, they should
include a three digit prefix before the numbers. I would like a message box
to pop up if they fail to do this and delete what they have put in the cell
thus forcing them to try again. For example 09/123 would be rejected but
SUM09/123 would be ok.

Thanks in advance.
--
Traa Dy Liooar

Jock
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default Message box warning of missing data

Select the sheet tab which you want to work with. Right click the sheet tab
and click on 'View Code'. This will launch VBE. Paste the below code to the
right blank portion. Get back to to workbook and try out.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 4 And Target.Count = 1 And Target.Text < "" Then
If Not Target.Text Like "[A-Z][A-Z][A-Z]#*" Then
Target = "": Target.Select
'Msbgox "Display a message"
End If
End If
End Sub

--
Jacob


"Jock" wrote:

Hi,
When a user inputs data (numbers) into cells in column D, they should
include a three digit prefix before the numbers. I would like a message box
to pop up if they fail to do this and delete what they have put in the cell
thus forcing them to try again. For example 09/123 would be rejected but
SUM09/123 would be ok.

Thanks in advance.
--
Traa Dy Liooar

Jock

Reply
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
External Data Warning Message - I have No External Data in wrkbk Cass_makeitfun[_2_] Excel Discussion (Misc queries) 0 May 12th 10 09:02 PM
Warning message on "number of data points" Chart blues Charts and Charting in Excel 6 March 4th 09 09:48 PM
warning message Mike Excel Discussion (Misc queries) 3 March 10th 06 06:20 PM
run macro after yes to data validation warning message al007 Excel Programming 0 November 17th 05 04:25 PM
Pop up warning message! canix Excel Programming 1 August 5th 05 07:15 PM


All times are GMT +1. The time now is 06:18 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"