Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 208
Default Complex Data Validation

I am trying to perform a strange and complex data Validation on a doc. It
will be between three different sheets. What I need is depending on if a
column on the first sheet says "Complete" I need a warning to pop up, when on
the other two sheets which also have the same corresponding projects, when I
try to enter hours for that project that has "Complete" in the first page.
So I have three sheets with the same projects listed but the first page it a
total of hours and status (complete, in work, canceled) then the second sheet
has hours each week for each project, and finally the final sheet has team
members hours for each week and project they worked on. So for the second
page I need an error to pop up when I try to enter hours for this week on a
completed project and for sheet three I need and error to pop up when I type
in the project code of a completed project.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4,339
Default Complex Data Validation

Try this:-

Asumptions:

1. Sheets are Sheets 1 to 3
2. Project ID is in Column A of ALL sheets
3. "Completed" is column B of Sheet1

Adjust code below as required.

To insert code, right click on tabof sheet2, select "View code" and copy/
paste code below.

Repeat for sheet3.

HTH


Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo ws_exit
Application.EnableEvents = False
project = Cells(Target.Row, "A") '<=== Project ID in column A
res = Application.Match(project, Worksheets("sheet1").Range("A:A"), 0)
If Not IsError(res) Then
If Worksheets("sheet1").Range("B" & res) = "Completed" then
MsgBox "This project is completed: no data entry allowed"
Target.Value = "" '<== Reset input to blank
End If
End If

ws_exit:
Application.EnableEvents = True

End Sub

"Sean" wrote:

I am trying to perform a strange and complex data Validation on a doc. It
will be between three different sheets. What I need is depending on if a
column on the first sheet says "Complete" I need a warning to pop up, when on
the other two sheets which also have the same corresponding projects, when I
try to enter hours for that project that has "Complete" in the first page.
So I have three sheets with the same projects listed but the first page it a
total of hours and status (complete, in work, canceled) then the second sheet
has hours each week for each project, and finally the final sheet has team
members hours for each week and project they worked on. So for the second
page I need an error to pop up when I try to enter hours for this week on a
completed project and for sheet three I need and error to pop up when I type
in the project code of a completed project.

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
complex data validation maryj Excel Discussion (Misc queries) 4 December 28th 06 06:02 PM
data validation invalid in dynamic validation list ilia Excel Discussion (Misc queries) 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
Complex Vlookup and List Validation and Nested IF statements Bobby Excel Worksheet Functions 2 March 9th 06 05:37 PM
complex validation for lottery numbers [email protected] Excel Discussion (Misc queries) 2 February 9th 05 03:15 PM


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