View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default Dorp-Down Formatting

Here is a VBA example:

Suppose we have the data validation input in cell A1 and the actual list in
H1 thru H10 ( each item with its own unique format ). In worksheet code:

Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Range("A1"), Target) Is Nothing Then
Exit Sub
End If
v = Target.Value
Application.EnableEvents = False
For i = 1 To 10
If v = Cells(i, "H").Value Then
Cells(i, "H").Copy
Target.PasteSpecial Paste:=xlPasteFormats
Application.EnableEvents = True
Exit Sub
End If
Next
Application.EnableEvents = True
End Sub

This routine activates once A1 is filled and then looks down the list to
find the match. Once found, the routine copies the format of the matched
cell back to A1

REMEMBER: worksheet code
--
Gary''s Student
gsnu200712