Hi all, i spent a good portion of the day trying to figure this out without any success. I created a macro that uses a system generated report to sort data and transfer it to a separate sheet. The thing is, the report is generated every day with sheet name as "Ledger Account Detail_20190415_" and tomorrow it will be named "...20190416_"
How do i make the macro look at "Sheet1" instead of the system given name? Or if its possible to maybe have the macro just look at only the portion of the system named sheet, for example "Ledger Account Detail*" Below is a portion of the code from my macro, I tried different variances of naming it Sheet(1).select, Worksheet("Sheet1"), etc. and none have worked for me.
ActiveWorkbook.Worksheets("Ledger Account Detail_20190412_").AutoFilter.Sort. _
SortFields.Clear
ActiveWorkbook.Worksheets("Ledger Account Detail_20190412_").AutoFilter.Sort. _
SortFields.Add2 Key:=Range("B1"), SortOn:=xlSortOnValues, Order:= _
xlAscending, DataOption:=xlSortNormal
How do i make the macro look at "Sheet1" instead of the system given name? Or if its possible to maybe have the macro just look at only the portion of the system named sheet, for example "Ledger Account Detail*" Below is a portion of the code from my macro, I tried different variances of naming it Sheet(1).select, Worksheet("Sheet1"), etc. and none have worked for me.
ActiveWorkbook.Worksheets("Ledger Account Detail_20190412_").AutoFilter.Sort. _
SortFields.Clear
ActiveWorkbook.Worksheets("Ledger Account Detail_20190412_").AutoFilter.Sort. _
SortFields.Add2 Key:=Range("B1"), SortOn:=xlSortOnValues, Order:= _
xlAscending, DataOption:=xlSortNormal