dpaton05
Well-known Member
- Joined
- Aug 14, 2018
- Messages
- 2,352
- Office Version
- 365
- 2016
- Platform
- Windows
I have a for each block where I want to assign the value in column 5 of the found row to the variable Serv.
This line is highlighted saying type mismatch
Can someone help tell me why please?
VBA Code:
For Each ws In wb2.Worksheets
If ws.Name <> "Cancellations" And ws.Name <> "Totals" Then
With ws.[A3].CurrentRegion
'Autofilter the late cancel date enter in B34 with dates in column 1
.AutoFilter 1, LCDt
'Autofilter the late cancel request number with request numbers in column 3
.AutoFilter 3, LCReq
'The service in column 5 is assigned to the Serv variable for use with calculating the late cancel price
Serv = .Offset(1, 5).Value
Debug.Print Serv
.Offset(1).EntireRow.Delete
.AutoFilter
End With
End If
Next ws
This line is highlighted saying type mismatch
VBA Code:
Serv = .Offset(1, 5).Value
Can someone help tell me why please?