I search a macro that is if inserted a new row, then Column A cell of that new row will fill-down above cell formula which deals with auto numbering. The formula is:
=IF(TRIM(B3)<>"",COUNTA($B$3:B3)&".","")
In Column B, I have names of 300 Staff of my organization with one row interval to differentiate between States. If a new staff join our organization, I need to insert a row within his/her State. And I use a macro below to work it.
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = ActiveCell.Column Then
refRow = Target.Row - 1
thisRow = Target.Row
Range("A" & refRow & ":A" & refRow).Copy Range("A" & thisRow & ":A" & thisRow)
End If
End Sub
It works fine in Sheet1. Here is my problem:
In Column A and B of Sheet2 and Sheet3, I link rows with Sheet 1's Column A and B, by using simple:
=Sheet1!A3
=Sheet1!B3
These two columns of all sheets are the same, starting at row 3 of all sheets. I want an event that if I insert a new row in Sheet1, then it will insert a new row of same position into Sheet2 and Sheet3. Then copy relative formula from the above cells in Sheet2 and Sheet3. I have got the above macro for Sheet1, but can't apply to all Sheets. I tried to copy that macro into Sheet2 and Sheet3, but it doesn't work. How could I make it work?