View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
[email protected] EagleOne@discussions.microsoft.com is offline
external usenet poster
 
Posts: 391
Default VBA (or Excel) crashes if Count of Visible Rows in Autofilter Rang

Tom, I replied via Google but I do not yet see it via Agent

Tom Ogilvy wrote:

do it manually - you will see that when only one cell is selected, then the
special cells command works on the entiresheet.


Possible work around:

Set CurrRng = wks.Range(wks.Cells(DataStartRow, DataTopCol).Address, _
wks.Cells(wks.Cells(Rows.Count, "B").End(xlUp).Row, _
DataTopCol))

Set CurrRng = Intersect(CurrRng,CurrRng.SpecialCells(xlCellTypeV isible))