ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Selecting Range After AutoFilter (https://www.excelbanter.com/excel-programming/286330-selecting-range-after-autofilter.html)

Randal W. Hozeski

Selecting Range After AutoFilter
 
I have code that runs an AutoFilter, on a six column
dataset in column A thru F. I use the following code
to try select a part of the result.

With .AutoFilter.Range
.Offset(0, 1).Resize(.Rows.Count - 0). _
SpecialCells(xlVisible).Select
End With

This will start the select in Column B but then runs it
out thru column G (a blank)

Question: Is there a way to just select column B,C, & D?
Thanks. -Randy-

..



Dale Hymel

Selecting Range After AutoFilter
 
Try:
With .AutoFilter.Range
.Offset(0, 1).Resize(.Rows.Count ,3).SpecialCells(xlVisible).Select
End With

or

Range("B:D").Select

This will select only the visible cells when in the filter mode.



"Randal W. Hozeski" wrote in message
news:cItHb.498285$275.1405392@attbi_s53...
I have code that runs an AutoFilter, on a six column
dataset in column A thru F. I use the following code
to try select a part of the result.

With .AutoFilter.Range
.Offset(0, 1).Resize(.Rows.Count - 0). _
SpecialCells(xlVisible).Select
End With

This will start the select in Column B but then runs it
out thru column G (a blank)

Question: Is there a way to just select column B,C, & D?
Thanks. -Randy-

.





Randal W. Hozeski

Selecting Range After AutoFilter
 
The first one work fine!! Thanks. -Randy-



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Dana DeLouis[_3_]

Selecting Range After AutoFilter
 
Perhaps just another way...

Sub Demo()
With ActiveSheet.AutoFilter
Intersect(.Range, .Range.Offset(1, 0),
[B:D]).SpecialCells(xlVisible).Select
End With
End Sub

--
Dana DeLouis
Using Windows XP & Office XP
= = = = = = = = = = = = = = = = =


"Randal W. Hozeski" wrote in message
news:cItHb.498285$275.1405392@attbi_s53...
I have code that runs an AutoFilter, on a six column
dataset in column A thru F. I use the following code
to try select a part of the result.

With .AutoFilter.Range
.Offset(0, 1).Resize(.Rows.Count - 0). _
SpecialCells(xlVisible).Select
End With

This will start the select in Column B but then runs it
out thru column G (a blank)

Question: Is there a way to just select column B,C, & D?
Thanks. -Randy-

.





Randal W. Hozeski

Selecting Range After AutoFilter
 
Thanks I will try it.

How about taking it one step further?

Naming that range? I want to use the
name "test" that was defined earlier,
but after deleting it and redefining it,
the recorder put those referrs to: actual
locations in there. or even better define
ranges within. First 13 entires(rows) = test1
next 13 test2, etc with the last one being
a partial list.

-Randy-





*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


All times are GMT +1. The time now is 09:58 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com