Currently using this to move a list of names to my headers on another sheet but when I add to the list and update my headers I need to resort my data columns as the new header column is added in alphabetically
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Application.CountIf(Range("A:A"), Target) > 1 Then
MsgBox "Duplicate Data!", vbCritical, "Remove Duplicate"
Target.Value = ""
End If
With Sheets("My_Setup")
.Range("A2:A51").Sort key1:=.Range("A2"), order1:=xlAscending, Header:=xlNo, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, DataOption1:=xlSortNormal
End With
End Sub
VBA Code:
Sub AddMyHeaders()
Worksheets("My_Setup").Range("A2:A51").Copy
Worksheets("My_Sagas").Range("E1").PasteSpecial Transpose:=True
'AutoFit All Columns on Worksheet
Worksheets("My_Sagas").Range("E:BB").EntireColumn.AutoFit
End Sub