#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 251
Default Data Validation

In data validation I have selected "list" under "Allow" and then put the
Source in my dragging down on the list I have created at the bottom of the
spreadsheet. The list is this:
D = Delivery - delivery too long
P = Price
CC = Customer changed requirements
OE = Order error, customer
SDH = Shutdown - Holiday
SDM = Shutdown - Mechanical
SDO - Shutdown - Other

My question is this: is there a way that when any one of them is selected
that it puts in only the code, i.e. D, P, CC, OE, SDH, etc.? Connie

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Data Validation

Debra Dalgleish shows a way:
http://contextures.com/excelfiles.html#DataVal

Look for:
DV0004 - Data Validation Change -- Select a Product from the Data Validation
list; an event procedure changes the product name to a product code.
DataValCode.zip 8 kb

Connie Martin wrote:

In data validation I have selected "list" under "Allow" and then put the
Source in my dragging down on the list I have created at the bottom of the
spreadsheet. The list is this:
D = Delivery - delivery too long
P = Price
CC = Customer changed requirements
OE = Order error, customer
SDH = Shutdown - Holiday
SDM = Shutdown - Mechanical
SDO - Shutdown - Other

My question is this: is there a way that when any one of them is selected
that it puts in only the code, i.e. D, P, CC, OE, SDH, etc.? Connie


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 251
Default Data Validation

Thank you for responding. I have tried to adapt this example, following it
to the letter, as far as I can see, but when I select from the dropdown list,
it opens the code with a pop-up which says, "Compile error: Ambiguous name
detected: Worksheet_Change". I've looked at Help on this but it's Greek to
me. I have another macro in this workbook, so I don't know if there's some
sort of conflict, or what. Can you give me any idea? Thank you. Connie

"Dave Peterson" wrote:

Debra Dalgleish shows a way:
http://contextures.com/excelfiles.html#DataVal

Look for:
DV0004 - Data Validation Change -- Select a Product from the Data Validation
list; an event procedure changes the product name to a product code.
DataValCode.zip 8 kb

Connie Martin wrote:

In data validation I have selected "list" under "Allow" and then put the
Source in my dragging down on the list I have created at the bottom of the
spreadsheet. The list is this:
D = Delivery - delivery too long
P = Price
CC = Customer changed requirements
OE = Order error, customer
SDH = Shutdown - Holiday
SDM = Shutdown - Mechanical
SDO - Shutdown - Other

My question is this: is there a way that when any one of them is selected
that it puts in only the code, i.e. D, P, CC, OE, SDH, etc.? Connie


--

Dave Peterson

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Data Validation

You get one worksheet_change event per worksheet. If you want to do different
things based on different changes, then you'll have to merge your code into a
single procedure.

Without knowing what you're doing, the "basic" code could be as simple as:

Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
If Not (Intersect(Target, Me.Range("A1")) Is Nothing) Then
'do the stuff for the change to A1
Else
If Not (Intersect(Target, Me.Range("q7:z99")) Is Nothing) Then
'do the stuff for q7:z99
End If
End If
End Sub



Connie Martin wrote:

Thank you for responding. I have tried to adapt this example, following it
to the letter, as far as I can see, but when I select from the dropdown list,
it opens the code with a pop-up which says, "Compile error: Ambiguous name
detected: Worksheet_Change". I've looked at Help on this but it's Greek to
me. I have another macro in this workbook, so I don't know if there's some
sort of conflict, or what. Can you give me any idea? Thank you. Connie

"Dave Peterson" wrote:

Debra Dalgleish shows a way:
http://contextures.com/excelfiles.html#DataVal

Look for:
DV0004 - Data Validation Change -- Select a Product from the Data Validation
list; an event procedure changes the product name to a product code.
DataValCode.zip 8 kb

Connie Martin wrote:

In data validation I have selected "list" under "Allow" and then put the
Source in my dragging down on the list I have created at the bottom of the
spreadsheet. The list is this:
D = Delivery - delivery too long
P = Price
CC = Customer changed requirements
OE = Order error, customer
SDH = Shutdown - Holiday
SDM = Shutdown - Mechanical
SDO - Shutdown - Other

My question is this: is there a way that when any one of them is selected
that it puts in only the code, i.e. D, P, CC, OE, SDH, etc.? Connie


--

Dave Peterson


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 251
Default Data Validation

You've lost me! Sorry! The other worksheet change I have in this worksheet
is this:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Then Exit Sub
If Not (Application.Intersect(Target, Range("A2:A5000,C2:C5000,J2:J5000"))
Is Nothing) _
Then
With Target
If Not .HasFormula Then
Application.EnableEvents = False
.Value = UCase(.Value)
Application.EnableEvents = True
End If
End With
End If
End Sub


"Dave Peterson" wrote:

You get one worksheet_change event per worksheet. If you want to do different
things based on different changes, then you'll have to merge your code into a
single procedure.

Without knowing what you're doing, the "basic" code could be as simple as:

Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
If Not (Intersect(Target, Me.Range("A1")) Is Nothing) Then
'do the stuff for the change to A1
Else
If Not (Intersect(Target, Me.Range("q7:z99")) Is Nothing) Then
'do the stuff for q7:z99
End If
End If
End Sub



Connie Martin wrote:

Thank you for responding. I have tried to adapt this example, following it
to the letter, as far as I can see, but when I select from the dropdown list,
it opens the code with a pop-up which says, "Compile error: Ambiguous name
detected: Worksheet_Change". I've looked at Help on this but it's Greek to
me. I have another macro in this workbook, so I don't know if there's some
sort of conflict, or what. Can you give me any idea? Thank you. Connie

"Dave Peterson" wrote:

Debra Dalgleish shows a way:
http://contextures.com/excelfiles.html#DataVal

Look for:
DV0004 - Data Validation Change -- Select a Product from the Data Validation
list; an event procedure changes the product name to a product code.
DataValCode.zip 8 kb

Connie Martin wrote:

In data validation I have selected "list" under "Allow" and then put the
Source in my dragging down on the list I have created at the bottom of the
spreadsheet. The list is this:
D = Delivery - delivery too long
P = Price
CC = Customer changed requirements
OE = Order error, customer
SDH = Shutdown - Holiday
SDM = Shutdown - Mechanical
SDO - Shutdown - Other

My question is this: is there a way that when any one of them is selected
that it puts in only the code, i.e. D, P, CC, OE, SDH, etc.? Connie

--

Dave Peterson


--

Dave Peterson



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 251
Default Data Validation

Dave, never mind! I don't really need that other worksheet change. I
deleted it and this one you sent me works great. Thank you. Connie

"Dave Peterson" wrote:

You get one worksheet_change event per worksheet. If you want to do different
things based on different changes, then you'll have to merge your code into a
single procedure.

Without knowing what you're doing, the "basic" code could be as simple as:

Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
If Not (Intersect(Target, Me.Range("A1")) Is Nothing) Then
'do the stuff for the change to A1
Else
If Not (Intersect(Target, Me.Range("q7:z99")) Is Nothing) Then
'do the stuff for q7:z99
End If
End If
End Sub



Connie Martin wrote:

Thank you for responding. I have tried to adapt this example, following it
to the letter, as far as I can see, but when I select from the dropdown list,
it opens the code with a pop-up which says, "Compile error: Ambiguous name
detected: Worksheet_Change". I've looked at Help on this but it's Greek to
me. I have another macro in this workbook, so I don't know if there's some
sort of conflict, or what. Can you give me any idea? Thank you. Connie

"Dave Peterson" wrote:

Debra Dalgleish shows a way:
http://contextures.com/excelfiles.html#DataVal

Look for:
DV0004 - Data Validation Change -- Select a Product from the Data Validation
list; an event procedure changes the product name to a product code.
DataValCode.zip 8 kb

Connie Martin wrote:

In data validation I have selected "list" under "Allow" and then put the
Source in my dragging down on the list I have created at the bottom of the
spreadsheet. The list is this:
D = Delivery - delivery too long
P = Price
CC = Customer changed requirements
OE = Order error, customer
SDH = Shutdown - Holiday
SDM = Shutdown - Mechanical
SDO - Shutdown - Other

My question is this: is there a way that when any one of them is selected
that it puts in only the code, i.e. D, P, CC, OE, SDH, etc.? Connie

--

Dave Peterson


--

Dave Peterson

  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Data Validation

Well, that makes it easy <vbg.

Connie Martin wrote:

Dave, never mind! I don't really need that other worksheet change. I
deleted it and this one you sent me works great. Thank you. Connie

"Dave Peterson" wrote:

You get one worksheet_change event per worksheet. If you want to do different
things based on different changes, then you'll have to merge your code into a
single procedure.

Without knowing what you're doing, the "basic" code could be as simple as:

Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
If Not (Intersect(Target, Me.Range("A1")) Is Nothing) Then
'do the stuff for the change to A1
Else
If Not (Intersect(Target, Me.Range("q7:z99")) Is Nothing) Then
'do the stuff for q7:z99
End If
End If
End Sub



Connie Martin wrote:

Thank you for responding. I have tried to adapt this example, following it
to the letter, as far as I can see, but when I select from the dropdown list,
it opens the code with a pop-up which says, "Compile error: Ambiguous name
detected: Worksheet_Change". I've looked at Help on this but it's Greek to
me. I have another macro in this workbook, so I don't know if there's some
sort of conflict, or what. Can you give me any idea? Thank you. Connie

"Dave Peterson" wrote:

Debra Dalgleish shows a way:
http://contextures.com/excelfiles.html#DataVal

Look for:
DV0004 - Data Validation Change -- Select a Product from the Data Validation
list; an event procedure changes the product name to a product code.
DataValCode.zip 8 kb

Connie Martin wrote:

In data validation I have selected "list" under "Allow" and then put the
Source in my dragging down on the list I have created at the bottom of the
spreadsheet. The list is this:
D = Delivery - delivery too long
P = Price
CC = Customer changed requirements
OE = Order error, customer
SDH = Shutdown - Holiday
SDM = Shutdown - Mechanical
SDO - Shutdown - Other

My question is this: is there a way that when any one of them is selected
that it puts in only the code, i.e. D, P, CC, OE, SDH, etc.? Connie

--

Dave Peterson


--

Dave Peterson


--

Dave Peterson
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
Validation Data using Validation Table cell range..... Dermot Excel Discussion (Misc queries) 16 January 5th 10 09:35 PM
Data Validation Update Validation Selection PCreighton Excel Worksheet Functions 3 September 11th 07 03:32 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 12:55 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"