S
Steved
Hello from Steved
A message box comes up with "Constant Expression Required".
It highlights What:=sFIND, _ sFIND,_
Also can I run this code as an Event please
Thankyou.
Sub test()
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 Sub
A message box comes up with "Constant Expression Required".
It highlights What:=sFIND, _ sFIND,_
Also can I run this code as an Event please
Thankyou.
Sub test()
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 Sub