Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Method 'Range" of object'_Global" failed

Tags:

excel

vba

I have taken a Excel document we use at work and modified it for a separate task that has developed.

I was told that as long as column E remained a date then the "Show Only Most Recent Issuance" macro should still run.

However I am receiving the above Run Time Error and when I select debug I am unsure what to change in order to fix said error.

Any help would be greatly appreciated.

ActiveSheet.ListObjects("Table1").Sort. _
    SortFields.Add Key:=Range("Table1[Issuance" & Chr(10) & "Date]"), SortOn:=xlSortOnValues _
    , Order:=xlDescending, DataOption:=xlSortNormal

The changes I made were only to the column titles and also to the data validation ranges for columns that should not be included in the macro.

Thanks.

like image 600
Leah Ford Avatar asked May 16 '26 20:05

Leah Ford


1 Answers

I'm guessing you changed the column title in column E. Before it looks like it was "Issuance Date" with a line break in-between Issuance and Date.

If you did change that column title you either need to change it back or update the macro to use the new name. The column name should go between the brackets, after "Table1".

like image 168
Justin C Avatar answered May 18 '26 18:05

Justin C



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!