Home |
Search |
Today's Posts |
#1
|
|||
|
|||
Macro Modification Help
All,
Below is a macro for updating a validation list. It works fine for one list but I have several lists on my worksheet ..they are in columns D,E,F,I,J, and K... Can someone help me modify the macro so that I can use it for all of my validaton lists? Each list has the offset parmameters attached to their defined names: example: =OFFSET(Lookup!$C$2,0,0,COUNTA(Lookup!$C:$C),1) All are on my lookup page in columns C,D,E,F,G,H The macro works for my list called "Platforms" Private Sub Worksheet_Change(ByVal Target As Range) On Error Resume Next Dim ws As Worksheet Dim i As Integer Set ws = Worksheets("Lookup") If Target.Column = 4 And Target.Row 1 Then If Application.WorksheetFunction.CountIf(ws.Range("Pl atforms"), Target.Value) Then Exit Sub Else i = ws.Cells(Rows.Count, 1).End(xlUp).Row + 1 ws.Range("C" & i).Value = Target.Value ws.Range("NameList").Sort Key1:=ws.Range("C2"), _ Order1:=xlAscending, Header:=xlGuess, _ OrderCustom:=1, MatchCase:=False, _ Orientation:=xlTopToBottom End If End If End Sub Thank you for your help |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Playing a macro from another workbook | Excel Discussion (Misc queries) | |||
automatic macro update | Excel Worksheet Functions | |||
Date macro | Excel Discussion (Misc queries) | |||
Macro and If Statement | Excel Discussion (Misc queries) | |||
Macro for multiple charts | Excel Worksheet Functions |