Hello! I am new into VBA Excel.
I wanna create a database for each month, with 1 'Main Sheet' for the list of name, and the list on 'Main Sheet' will sort automatically as a row when I entered a data along with the update of the other sheet.
I found this code, and it's only updated/sorting in the sheet entered (let's we said the 'Main Sheet'). Is that possible if the entered data and sorting updated automatically in all other sheet?
I tried referencing/paste link the name for each month (start from A2), but I have no idea to keep the column beside A2 (B2, C2, etc) sticking with the A2 as a full row.
Thanks!
I wanna create a database for each month, with 1 'Main Sheet' for the list of name, and the list on 'Main Sheet' will sort automatically as a row when I entered a data along with the update of the other sheet.
I found this code, and it's only updated/sorting in the sheet entered (let's we said the 'Main Sheet'). Is that possible if the entered data and sorting updated automatically in all other sheet?
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Column = 1 Then
Dim lastRow As Long
lastRow = Cells(Rows.Count, 1).End(xlUp).Row
Range("A2:BN2" & lastRow).Sort key1:=Range("A2:A" & lastRow), order1:=xlAscending, Header:=xlNo
End If
End Sub
I tried referencing/paste link the name for each month (start from A2), but I have no idea to keep the column beside A2 (B2, C2, etc) sticking with the A2 as a full row.
Thanks!