Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
07-04-22 09:43 AM
Hi,
Can the template Get Worksheet As Collection be altered so it only gets visible data?
Dim ws as Object = _
GetWorksheet(handle, workbookname, worksheetname, False)
' Do we have a sheet?
sheetexists = ws IsNot Nothing
' No sheet? No entry.
If Not sheetexists Then Return
ws.Activate()
worksheetCollection = GetWorksheetUsedRangeAsDataTable(ws.UsedRange, True)
Since my collection is too large I'm applying an AutoFilter using this:
Dim worksheet as Object
Worksheet = GetWorkbook(handle, Nothing).ActiveSheet
worksheet.UsedRange.AutoFilter (Field:= FieldToBeFiltered, Criteria1 := criteriaToFilter)
But I'm having a hard time extracting this data without the VBO trying to get the whole sheet which breaks the memory.
Best Regards
Atli
Answered! Go to Answer.
1 BEST ANSWER
Helpful Answers
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
07-04-22 10:23 AM
Hi Atli,
Use "Ws.Cells.SpecialCells(xlCellTypeVisible)" it will give you only visible cells
Thanks
Nilesh
Use "Ws.Cells.SpecialCells(xlCellTypeVisible)" it will give you only visible cells
Thanks
Nilesh
Nilesh Jadhav.
Consultant
ADP,India
Consultant
ADP,India
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
07-04-22 10:23 AM
Hi Atli,
Use "Ws.Cells.SpecialCells(xlCellTypeVisible)" it will give you only visible cells
Thanks
Nilesh
Use "Ws.Cells.SpecialCells(xlCellTypeVisible)" it will give you only visible cells
Thanks
Nilesh
Nilesh Jadhav.
Consultant
ADP,India
Consultant
ADP,India
