I have two problems that are seemingly impossible to fix. First is a type mismatch that I can't place. (error 13)
The goal is to delete every empty row in the range between blocks of data. Every variable I call (i, y, and rows) are defined. Should i or rows not be longs?
Second is a line telling me I need an object when it was working fine before I tried to solve problem 1 and never even touched it. (error 424)
This one I really can't figure out. I don't know what object it wants me to call if I'm already telling it to select the used range of the active worksheet and sort in ascending order, then descending order by two different values. The sheet has headers and is sorting by time, then date.
Sub Import()
Dim xSht As Worksheet, xWb As Workbook
Dim xFileDialog As FileDialog, f, i, rows, r As Long
Dim xStrPath As String, xFile As String
Dim y As Range
Dim iCntr
Dim rng As Range
Set rng = Range("A10:D20")
Application.ScreenUpdating = False
.
.
.
.
.
Set y = Range("A1:D2000")
For i = y.Row + y.rows.Count - 1 To y.Row Step -1
If Application.WorksheetFunction.CountA(rows(i)) = 0 _
Then rows(i).EntireRow.Delete
Next
Worksheets("BY SHIFT").Activate
Worksheets("BY SHIFT").Sort.SortFields.Clear
ActiveWorksheet.UsedRange.Sort Key1:=Range("C1"), Key2:=Range("B1"), Header:=xlYes, _
Order1:=xlAscending, Order2:=xlDescending
Worksheets("2718").Activate
Application.ScreenUpdating = True
End Sub