在Excel中筛选特定的列号

我想使用VBScript在Excel中筛选特定的列CS 。 这是我迄今为止。 我基本上想过滤列CS与stringstatusGiven

 wb.Sheets("Profile").Range("A1:DD500").AutoFilter 130, statusGiven 

我认为可能有一个更简单的方法,而不是统计直到CS的列数。

您可以使用Column属性返回列号:

 With wb.Sheets("Profile") .Range("A1:DD500").AutoFilter .Columns("CS").Column, statusGiven End With