Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
conditional Formatting based on cell formatting | Excel Worksheet Functions | |||
conditional Formatting based on cell formatting | Excel Worksheet Functions | |||
expanding custom formatting without removing existing cell formatting? | Excel Worksheet Functions | |||
dorp down lists | Excel Discussion (Misc queries) | |||
Pivot Table border formatting and pivot chart formatting | Excel Discussion (Misc queries) |