Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default data validation

i have a list of phone numbers (C1:C100), in A1 you enter in a phone number, if the number you enter is from the list, nothing happens, if it is not on the list, i need a text box to pop up saying "Continue" then yes or no. if yes, i need Macro1, if no, nothing to happen

Thanks in advance
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default data validation

Dim ans
If WorksheetFunction.CountIf(Range("C1:C100"), Range("A1")) 0 Then
ans = MsgBox("Continue", vbYesNo)
If ans = vbYes Then macro1
End If


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Choice" wrote in message
...
i have a list of phone numbers (C1:C100), in A1 you enter in a phone

number, if the number you enter is from the list, nothing happens, if it is
not on the list, i need a text box to pop up saying "Continue" then yes or
no. if yes, i need Macro1, if no, nothing to happen.

Thanks in advance



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default data validation

This is what i put in but nothing seems to be working, im not sure if i am supposed to change anything with the worksheet functio

Dim an
If WorksheetFunction.CountIf(Range("Tracking!C4:C1000 "), Range("Sale!P2")) 0 The
ans = MsgBox("Please Enter in Tracker", vbYesNo
If ans = vbYes Then SortTracke
End If
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default data validation

Put it in a worksheet change event

Private Sub Worksheet_Change(ByVal Target As Range)
Dim ans
If Target.Address = "$A$1" Then
If WorksheetFunction.CountIf(Range("C1:C100"), Range("A1")) 0 Then
ans = MsgBox("Continue", vbYesNo)
If ans = vbYes Then macro1
End If
End If

End Sub

right-click on the sheet tab, select View Code, and paste it in

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"choice" wrote in message
...
This is what i put in but nothing seems to be working, im not sure if i am

supposed to change anything with the worksheet function

Dim ans
If WorksheetFunction.CountIf(Range("Tracking!C4:C1000 "),

Range("Sale!P2")) 0 Then
ans = MsgBox("Please Enter in Tracker", vbYesNo)
If ans = vbYes Then SortTracker
End If



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default data validation

This might be better in the tracking worksheet

Private Sub Worksheet_Change(ByVal Target As Range)
Dim ans
If Target.Address = "$A$1" Then
If WorksheetFunction.CountIf(Range("C4:C100"), Range("Sale!P2")) 0
Then
ans = MsgBox("Continue", vbYesNo)
If ans = vbYes Then macro1
End If
End If

End Sub



--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Bob Phillips" wrote in message
...
Put it in a worksheet change event

Private Sub Worksheet_Change(ByVal Target As Range)
Dim ans
If Target.Address = "$A$1" Then
If WorksheetFunction.CountIf(Range("C1:C100"), Range("A1")) 0

Then
ans = MsgBox("Continue", vbYesNo)
If ans = vbYes Then macro1
End If
End If

End Sub

right-click on the sheet tab, select View Code, and paste it in

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"choice" wrote in message
...
This is what i put in but nothing seems to be working, im not sure if i

am
supposed to change anything with the worksheet function

Dim ans
If WorksheetFunction.CountIf(Range("Tracking!C4:C1000 "),

Range("Sale!P2")) 0 Then
ans = MsgBox("Please Enter in Tracker", vbYesNo)
If ans = vbYes Then SortTracker
End If







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
custom data validation on cells with data validation values AKrobbins Excel Worksheet Functions 2 June 21st 11 04:20 PM
Validation Data using Validation Table cell range..... Dermot Excel Discussion (Misc queries) 16 January 5th 10 09:35 PM
data validation invalid in dynamic validation list ilia Excel Discussion (Misc queries) 0 November 7th 06 12:54 PM
data validation invalid in dynamic validation list ilia Excel Worksheet Functions 0 November 7th 06 12:54 PM
Data validation with validation lists and combo boxs Keith Excel Discussion (Misc queries) 1 October 12th 06 11:08 AM


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