I have my VBA script working correctly, however, I do not understand why the dates on column "C" are set and changed to "General" when they should remain as Dates. If my dates do not land on Sheet 2 as Dates then formula on column "E" will not display Days Outstanding as sheet should display with formulas.
VBA Script below:
Sub deleteRowswithSelectedText4()
Dim lr As Long
Dim i As Long
Dim szRange As String
Dim rng As Range
lr = Cells(Rows.Count, 1).End(xlUp).Row
For i = lr - 1 To 2 Step -1
If Cells(i, "B") = "LLC" Then
Cells(i, "B").EntireRow.Delete
End If
Next i
szRange = "A118:D300"
Worksheet("Sheet1").Range("A16:B300,J16:J300,R16:R300").Copy_
Destination:=Worksheets("Sheet2").Range("A118:D300")
Worksheets("Sheet2").Range("C118:C300").NumberFormat = "m/d/yy"
End Sub
VBA Script below:
Sub deleteRowswithSelectedText4()
Dim lr As Long
Dim i As Long
Dim szRange As String
Dim rng As Range
lr = Cells(Rows.Count, 1).End(xlUp).Row
For i = lr - 1 To 2 Step -1
If Cells(i, "B") = "LLC" Then
Cells(i, "B").EntireRow.Delete
End If
Next i
szRange = "A118:D300"
Worksheet("Sheet1").Range("A16:B300,J16:J300,R16:R300").Copy_
Destination:=Worksheets("Sheet2").Range("A118:D300")
Worksheets("Sheet2").Range("C118:C300").NumberFormat = "m/d/yy"
End Sub