kpasa
Board Regular
- Joined
- Nov 20, 2015
- Messages
- 82
I have the following code to cycle through a table and find rows that match a few pieces of critical criteria.
I need to know how pull the specific cells from the matched row and continue to add to the array for all the matched rows.
After that, I'm looking to do two things:
Anyone have anything similar or can you offer some direction?
Code:
Sub FocusMissingAction()
Dim tbl As ListObject
Dim cell As Range
Set tbl = ActiveSheet.ListObjects("Table1")
For Each cell In tbl.ListColumns(1).DataBodyRange.Cells
If cell.Offset(0, 27) = "" And cell.Offset(0, 2) < Date And (cell.Offset(0, 10) = "" Or cell.Offset(0, 11) = "" Or cell.Offset(0, 23) = "") Then
'Add Certain cells in this row to a new array, maybe 6-8 cells
'for example, add cell and cell.offset(0,30) and cell.offset(0,31) to the array or collection.
'the number of columns I'll pull data from will not change, but the number of rows that match the criteria above will certainly change
Else
End If
Next
'create a new table for emailing to colleague
'use same info to display on a userform. Not for editing, just for quick viewing
End Sub
I need to know how pull the specific cells from the matched row and continue to add to the array for all the matched rows.
After that, I'm looking to do two things:
- Use the array to build a new table on a different sheet (required)
- Use the array to feed into a userform for quick viewing (not necessary, but nice-to-have)
Anyone have anything similar or can you offer some direction?
Last edited: