LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
TD TD is offline
external usenet poster
 
Posts: 29
Default using UsedRange.SpecialCells(xlCellTypeVisible).Areas(2)

Hi all,
I was using the following code:
Dim Tcell As Range
With ThisWorkbook.Sheets("Orders to be Submitted")
..Activate
Data = Trim(.Cells(ActiveCell.Row, 4))
.AutoFilterMode = False
.Range("1:1").AutoFilter
.Range("1:1").AutoFilter Field:=4, Criteria1:=Data
End With

For Each Tcell In
Sheet6.UsedRange.SpecialCells(xlCellTypeVisible).A reas(2).Rows
.....

It worked fine until eventually I was getting an error because areas(2)
wasn't defined. I found this only happened when my autofilter would give me
back rows directly under the header row (2-5 for example). This is rather
frustrating in that I was hoping the behavior would be the same in all
cases(no header row & Area2 defined). Am I doing something wrong or is there
a better way to deal with this?

Thanks much
-TD


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
xlCellTypeVisible - not working? JMB Excel Programming 0 June 9th 06 12:54 AM
xlCellTypeVisible - not working? Dave Peterson Excel Programming 0 June 8th 06 10:54 PM
activecell.specialcells(xlCellTypeVisible) returns column refe noel Excel Programming 1 January 4th 05 04:33 PM
SpecialCells and UsedRange Norm[_5_] Excel Programming 2 April 1st 04 06:53 PM
Worksheet function & SpecialCells(xlCellTypeVisible)? Charley Kyd[_2_] Excel Programming 2 March 5th 04 05:46 PM


All times are GMT +1. The time now is 08:32 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"