S
Steved
Hello from Steved
The below macro worked only one time I need to work each
time the worksheet is changed.
What is needed to get this to work please.
thankyou
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Application.CountIf(Cells, "TOTAL SHIFT
HOURS") Then
Application.EnableEvents = False
Const sFIND As String = "TOTAL SHIFT HOURS"
Dim vArr As Variant
Dim rFound As Range
Dim nCount As Long
vArr = Array
("City", "Roskill", "Papakura", "Wiri", "Shore", "Orewa",
"Swanson")
nCount = 0
Set rFound = Cells.Find( _
What:=sFIND, _
LookIn:=xlValues, _
LookAt:=xlPart, _
SearchOrder:=xlByColumns, _
SearchDirection:=xlNext, _
MatchCase:=False)
Do While Not rFound Is Nothing And nCount <= UBound
(vArr)
rFound.Value = vArr(nCount)
nCount = nCount + 1
Set rFound = Cells.FindNext(after:=rFound)
Loop
End If
End Sub
The below macro worked only one time I need to work each
time the worksheet is changed.
What is needed to get this to work please.
thankyou
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Application.CountIf(Cells, "TOTAL SHIFT
HOURS") Then
Application.EnableEvents = False
Const sFIND As String = "TOTAL SHIFT HOURS"
Dim vArr As Variant
Dim rFound As Range
Dim nCount As Long
vArr = Array
("City", "Roskill", "Papakura", "Wiri", "Shore", "Orewa",
"Swanson")
nCount = 0
Set rFound = Cells.Find( _
What:=sFIND, _
LookIn:=xlValues, _
LookAt:=xlPart, _
SearchOrder:=xlByColumns, _
SearchDirection:=xlNext, _
MatchCase:=False)
Do While Not rFound Is Nothing And nCount <= UBound
(vArr)
rFound.Value = vArr(nCount)
nCount = nCount + 1
Set rFound = Cells.FindNext(after:=rFound)
Loop
End If
End Sub