#1
|
|||
|
|||
Select first NOT hidden row in table
Hi All,
Trying to get this going, i have code that works fine if i debug and select the first row in a table that has hidden rows, then continues ok. I need code that after i have filtered my records to select the first row that is not hidden in my table. This what i have so far... Code:
Ass_Num = Intersect(acrow, tblColumns("Asset" & Chr(10) & "Number").Range) Sheets("backup").Select With ActiveSheet .ListObjects("Customers").Range.AutoFilter Field:=6, Criteria1:=Ass_Num ' filters rows, but the table looses the focus firstRow = .AutoFilter.Range.Offset(1).SpecialCells(xlCellTypeVisible).row ' this works on another table because its not filtered and the table has the focus Range("A" & firstRow).Select End With |
#2
|
|||
|
|||
Does this work :
Code:
Ass_Num = Intersect(acrow, tblColumns("Asset" & Chr(10) & "Number").Range) Sheets("backup").Select With ActiveSheet .ListObjects("Customers").Range.AutoFilter Field:=6, Criteria1:=Ass_Num ' filters rows, but the table looses the focus Columns(1).Cells.SpecialCells(xlCellTypeVisible).Cells(1).Select End With |
#3
|
|||
|
|||
Thanks for the reply,
I have tried that, just now i added - Call Sort_by_Asset_number this resorts the table and gives it focus and the code works now. Thanks for helping regards Trevor |
#4
|
|||
|
|||
Glad you have an answer.
|
#5
|
|||
|
|||
Another option might be to deal with the table only and bypass the header row when looking for the visible rows after filtering.
Code:
Ass_Num = Intersect(acrow, tblColumns("Asset" & Chr(10) & "Number").Range) Sheets("backup").Select With ActiveSheet.ListObjects("Customers") .Range.AutoFilter Field:=6, Criteria1:=Ass_Num Set fRng = .ListColumns(1).DataBodyRange.Cells.SpecialCells(xlCellTypeVisible) fRng.Cells(1).Select '.Range.AutoFilter End With |
Thread Tools | |
Display Modes | |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Looking to copy select cells in table using dropdown list to paste to new table in another worksheet | CaptainRetired | Excel Programming | 18 | 01-04-2018 07:22 PM |
Find first row in a table that is not hidden? | Officer_Bierschnitt | Excel Programming | 5 | 10-31-2015 09:42 AM |
programmatically inserting hidden text into a Word 2010 table | epid011 | Word VBA | 16 | 12-30-2013 11:29 AM |
Hidden text in table | Angel9520 | Word Tables | 1 | 05-02-2012 01:00 AM |
Select Text in Table but Table Gets Selected Too | RBusiness | Word | 1 | 06-07-2011 04:26 PM |