Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default msgbox in sheet

Since you already have a data validation in the cell..you will have to use
the worksheet event..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)
Dim rngTemp As Range
Set rngTemp = Range("A1:A5")
If Not Application.Intersect(Target, rngTemp) Is Nothing Then
If WorksheetFunction.CountIf(rngTemp, Target) 1 Then
Application.EnableEvents = False
Target = "": Target.Activate: MsgBox "Value already exist"
Application.EnableEvents = True
End If
End If
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"Peter" wrote:

Hi there.

In a sheet, I've got a validation list that contains the values to select
(ex: 1,2 3, 4, 5) and I select the value "1" on the first cell, then, in the
same column, second cell, if I choose the value "1" again, I want that apears
a msgbox saying that value is allready there and when I click in the button
on the msgbox, that second cell keeps blank, is it possible?

tku,

 
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
MsgBox from another sheet Ed Davis[_2_] Excel Discussion (Misc queries) 6 September 30th 09 02:33 PM
how can I get a msgbox? AND Excel Discussion (Misc queries) 0 February 12th 09 12:47 PM
code to close an excel sheet without saving it .(via msgbox) Satyam Reddy Excel Worksheet Functions 2 May 14th 08 02:48 PM
Display MsgBox when selecting a sheet Horatio J. Bilge, Jr. Excel Discussion (Misc queries) 3 October 11th 07 03:42 PM
MsgBox CC Excel Discussion (Misc queries) 4 May 5th 06 05:45 PM


All times are GMT +1. The time now is 11:07 PM.

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"