JoeyGaspard
Board Regular
- Joined
- Jul 22, 2019
- Messages
- 164
I created an excel file with some vba in it, everytime i close it, it wants me to save a copy, and everytime I open it, it gives me this message:
and when I click yes, it gives me this:
This is the error log text:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<recoveryLog xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"><logFileName>error095320_01.xml</logFileName><summary>Errors were detected in file 'https://houseofraeford-my.sharepoin...m/Documents/Desktop/AccountingTimeReport.xlsb'</summary><removedRecords><removedRecord>Removed Records: Sorting from /xl/worksheets/sheet6.bin part</removedRecord><removedRecord>Removed Records: Sorting from /xl/worksheets/sheet7.bin part</removedRecord><removedRecord>Removed Records: Sorting from /xl/worksheets/sheet8.bin part</removedRecord><removedRecord>Removed Records: Sorting from /xl/worksheets/sheet9.bin part</removedRecord><removedRecord>Removed Records: Sorting from /xl/worksheets/sheet10.bin part</removedRecord><removedRecord>Removed Records: Sorting from /xl/worksheets/sheet11.bin part</removedRecord><removedRecord>Removed Records: Sorting from /xl/worksheets/sheet12.bin part</removedRecord><removedRecord>Removed Records: Sorting from /xl/worksheets/sheet13.bin part</removedRecord></removedRecords></recoveryLog>
And below is my vba (I know its crude but it was working fine), I think it is the sorting, but Im not sure how to fix it as I have to have it?
Any help is greatly appreciated!!
and when I click yes, it gives me this:
This is the error log text:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<recoveryLog xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"><logFileName>error095320_01.xml</logFileName><summary>Errors were detected in file 'https://houseofraeford-my.sharepoin...m/Documents/Desktop/AccountingTimeReport.xlsb'</summary><removedRecords><removedRecord>Removed Records: Sorting from /xl/worksheets/sheet6.bin part</removedRecord><removedRecord>Removed Records: Sorting from /xl/worksheets/sheet7.bin part</removedRecord><removedRecord>Removed Records: Sorting from /xl/worksheets/sheet8.bin part</removedRecord><removedRecord>Removed Records: Sorting from /xl/worksheets/sheet9.bin part</removedRecord><removedRecord>Removed Records: Sorting from /xl/worksheets/sheet10.bin part</removedRecord><removedRecord>Removed Records: Sorting from /xl/worksheets/sheet11.bin part</removedRecord><removedRecord>Removed Records: Sorting from /xl/worksheets/sheet12.bin part</removedRecord><removedRecord>Removed Records: Sorting from /xl/worksheets/sheet13.bin part</removedRecord></removedRecords></recoveryLog>
And below is my vba (I know its crude but it was working fine), I think it is the sorting, but Im not sure how to fix it as I have to have it?
VBA Code:
Sub ProcessTime()
'Refresh Data Connection
ThisWorkbook.RefreshAll
'Copy Timereport-utf8 to Report
Sheets("timereport").Select
Range(Range("A2:G2"), Range("A2:G2").End(xlDown)).Copy
Worksheets("Report").Range("A1").PasteSpecial Paste:=xlPasteValues
' Remove columns From Report
Sheets("Report").Select
Range("A:A,C:C,G:G").Select
Range("G1").Activate
Selection.Delete Shift:=xlToLeft
Range("A1").Select
'Copy Report to Calculation
Sheets("Report").Select
Columns("A:D").Select
Selection.Copy
Sheets("Calculation").Select
Range("A1").Select
ActiveSheet.Paste
Range("A1").Select
With Sheets("Calculation")
.AutoFilterMode = False
.Range("A1").AutoFilter 1, "197565"
.AutoFilter.Range.Columns("A:D").Offset(1).Copy Sheets("AngieK").Range("A1")
.AutoFilterMode = False
End With
With Sheets("Calculation")
.AutoFilterMode = False
.Range("A1").AutoFilter 1, "197613"
.AutoFilter.Range.Columns("A:D").Offset(1).Copy Sheets("AdriannaP").Range("A1")
.AutoFilterMode = False
End With
With Sheets("Calculation")
.AutoFilterMode = False
.Range("A1").AutoFilter 1, "197460"
.AutoFilter.Range.Columns("A:D").Offset(1).Copy Sheets("DenittaA").Range("A1")
.AutoFilterMode = False
End With
With Sheets("Calculation")
.AutoFilterMode = False
.Range("A1").AutoFilter 1, "197634"
.AutoFilter.Range.Columns("A:D").Offset(1).Copy Sheets("KimR").Range("A1")
.AutoFilterMode = False
End With
With Sheets("Calculation")
.AutoFilterMode = False
.Range("A1").AutoFilter 1, "197564"
.AutoFilter.Range.Columns("A:D").Offset(1).Copy Sheets("KristiS").Range("A1")
.AutoFilterMode = False
End With
With Sheets("Calculation")
.AutoFilterMode = False
.Range("A1").AutoFilter 1, "197563"
.AutoFilter.Range.Columns("A:D").Offset(1).Copy Sheets("KristieJ").Range("A1")
.AutoFilterMode = False
End With
With Sheets("Calculation")
.AutoFilterMode = False
.Range("A1").AutoFilter 1, "19999"
.AutoFilter.Range.Columns("A:D").Offset(1).Copy Sheets("LeahC").Range("A1")
.AutoFilterMode = False
End With
With Sheets("Calculation")
.AutoFilterMode = False
.Range("A1").AutoFilter 1, "4"
.AutoFilter.Range.Columns("A:D").Offset(1).Copy Sheets("RachelO").Range("A1")
.AutoFilterMode = False
End With
'Sort Column Data
Sheets("LeahC").Select
With ActiveSheet.Sort
.SortFields.Add Key:=Range("B1"), Order:=xlAscending
.SetRange Range("A1:D50")
.Header = xlNo
.Apply
Columns("B:B").Select
Selection.NumberFormat = "m/d/yy h:mm;@"
End With
Sheets("KristieJ").Select
With ActiveSheet.Sort
.SortFields.Add Key:=Range("B1"), Order:=xlAscending
.SetRange Range("A1:D50")
.Header = xlNo
.Apply
Columns("B:B").Select
Selection.NumberFormat = "m/d/yy h:mm;@"
End With
Sheets("KristiS").Select
With ActiveSheet.Sort
.SortFields.Add Key:=Range("B1"), Order:=xlAscending
.SetRange Range("A1:D50")
.Header = xlNo
.Apply
Columns("B:B").Select
Selection.NumberFormat = "m/d/yy h:mm;@"
End With
Sheets("AngieK").Select
With ActiveSheet.Sort
.SortFields.Add Key:=Range("B1"), Order:=xlAscending
.SetRange Range("A1:D50")
.Header = xlNo
.Apply
Columns("B:B").Select
Selection.NumberFormat = "m/d/yy h:mm;@"
End With
Sheets("DenittaA").Select
With ActiveSheet.Sort
.SortFields.Add Key:=Range("B1"), Order:=xlAscending
.SetRange Range("A1:D50")
.Header = xlNo
.Apply
Columns("B:B").Select
Selection.NumberFormat = "m/d/yy h:mm;@"
End With
Sheets("KimR").Select
With ActiveSheet.Sort
.SortFields.Add Key:=Range("B1"), Order:=xlAscending
.SetRange Range("A1:D50")
.Header = xlNo
.Apply
Columns("B:B").Select
Selection.NumberFormat = "m/d/yy h:mm;@"
End With
Sheets("AdriannaP").Select
With ActiveSheet.Sort
.SortFields.Add Key:=Range("B1"), Order:=xlAscending
.SetRange Range("A1:D50")
.Header = xlNo
.Apply
Columns("B:B").Select
Selection.NumberFormat = "m/d/yy h:mm;@"
End With
Sheets("RachelO").Select
With ActiveSheet.Sort
.SortFields.Add Key:=Range("B1"), Order:=xlAscending
.SetRange Range("A1:D50")
.Header = xlNo
.Apply
Columns("B:B").Select
Selection.NumberFormat = "m/d/yy h:mm;@"
End With
Sheets("Totals").Select
End Sub
Any help is greatly appreciated!!