marreco
08-22-2012, 04:30 PM
Hi.
This is a common code, I need to run automatically each time the cell 'B5' changing information.
so I need to pass the routine Private Sub Worksheet_Change.
can anyone help me?
Thank you!
Private Sub Worksheet_Change(ByVal Target As Range)
Private Sub Worksheet_Change(ByVal Target As Range)
Dim Tc As Long, Day As Long
Day = Range("B5")
Tc = Application.WorksheetFunction.Match(Day, Range("d5:ag5"), 0)
For i = 8 To 149
Cells(i, Tc + 3) = Range("B" & i)
Next
End Sub
This is a common code, I need to run automatically each time the cell 'B5' changing information.
so I need to pass the routine Private Sub Worksheet_Change.
can anyone help me?
Thank you!
Private Sub Worksheet_Change(ByVal Target As Range)
Private Sub Worksheet_Change(ByVal Target As Range)
Dim Tc As Long, Day As Long
Day = Range("B5")
Tc = Application.WorksheetFunction.Match(Day, Range("d5:ag5"), 0)
For i = 8 To 149
Cells(i, Tc + 3) = Range("B" & i)
Next
End Sub