Hi All,
i currently use a code to tranpose data from Column B Data Entry (sheet1) to Database (sheet 2) using a cmdbutton
Once its on sheet 2 and has been pasted i want it to autosort based on a custom sort order (this works by itself just not with the VBA above) which refeshes when data is manualy entered into the columns on sheet 2
using
how can i get this custom sort to sort when the data is inserted from the cmdbutton on sheet 1?
i currently use a code to tranpose data from Column B Data Entry (sheet1) to Database (sheet 2) using a cmdbutton
VBA Code:
Private Sub CmbSubmit_Click()
Dim srcSht As Worksheet, destSht As Worksheet
Dim srcRng As Range, destRng As Range
Set srcSht = Worksheets("Data Entry")
Set destSht = Worksheets("Database")
With destSht
Set destRng = .Range("A" & Rows.Count).End(xlUp).Offset(1)
End With
With srcSht
Set srcRng = .Range("B1:B" & .Cells(Rows.Count, "B").End(xlUp).Row)
End With
srcRng.Copy
destRng.PasteSpecial Paste:=xlPasteValues, Transpose:=True
Application.CutCopyMode = False
Range("B:B").ClearContents
End Sub
Once its on sheet 2 and has been pasted i want it to autosort based on a custom sort order (this works by itself just not with the VBA above) which refeshes when data is manualy entered into the columns on sheet 2
using
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
ActiveSheet.AutoFilter.ApplyFilter
End Sub
how can i get this custom sort to sort when the data is inserted from the cmdbutton on sheet 1?