Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with Filtering rows in Excel via VFP

Status
Not open for further replies.

Goofus828

Programmer
Nov 9, 2005
127
US

I have a spreadsheet that I populate via VFP9. When I am in the spreadsheet sometimes I filter the table and forget to turn the filter off. When I add data via VFP, sometimes the data insertion gets 'misplaced' because of the filter. I know how to turn the filter off programmatically but I am having problems turning it on to filter a specific date and keep the blank rows in the table.

Here is the VBA line of code that I created via a macro:

This sets the filter to only show blank rows and the month of November 2021.
Code:
ActiveSheet.ListObjects("Inspections").Range.AutoFilter Field:=2, Criteria1:=Array("="), Operator:=xlFilterValues, Criteria2:=Array(1, "11/29/2021")


This only shows blank rows.
Code:
oExcel.ActiveSheet.ListObjects("inspections").Range.AutoFilter( 2,"=")

I do not know how to handle the criteria 2 in VFP
Code:
Criteria2:=Array(1, "11/29/2021")

Any help would be appreciated.
Josh
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top