作者:故事与酒 | 来源:互联网 | 2023-05-19 14:50
Ihaveaworksheetthatisupdatedregularly.Thereforethecolumnheaderpositionschangeregurlary
I have a worksheet that is updated regularly. Therefore the column header positions change regurlary. For example if today "Date" is in column J1 as the column header, tomorrow "Date" could be in column C1. Therefore if I want to perform sorting operations, using a macro for date, I cannot refer to it using a hard-coded cell reference for example
我有一个定期更新的工作表。因此列标题位置改变了regurlary。例如,如果今天“Date”在列J1中作为列标题,则明天“Date”可以在列C1中。因此,如果我想执行排序操作,使用宏作为日期,我不能使用硬编码的单元格引用来引用它,例如
cu.Range("J1").AutoFilter Field:=10, Criteria1:=">=" & Date
Is there a way in excel to search and locate a column header for example date. So that after I locate, I can perform the sorting based on current date.
有没有办法在Excel中搜索和查找列标题,例如日期。因此,在找到之后,我可以根据当前日期执行排序。
How can this be performed through a macro?
如何通过宏执行此操作?
1 个解决方案