Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default Selecting AutoFilter Rows

Hi,
I have a Filter in a spreadsheet and want to create a code in order to
select each visible row and change its content.
I have visible rows 2,3,4,10,15,50....3560,6550, etc
What code should I write to in order to select each row change its value and
continue till the end of the visible rows.
Regards
Pedro
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Selecting AutoFilter Rows

Pedro,

Look at the reply to your previous post.

KL

"Pedro" wrote in message
...
Hi,
I have a Filter in a spreadsheet and want to create a code in order to
select each visible row and change its content.
I have visible rows 2,3,4,10,15,50....3560,6550, etc
What code should I write to in order to select each row change its value
and
continue till the end of the visible rows.
Regards
Pedro



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default Selecting AutoFilter Rows

Thanks

But that will select all the range
I want to select each cell in A column and then change the value of it, then
it will continue doing it till the end of the shown rows

regards

"KL" wrote:

Pedro,

Look at the reply to your previous post.

KL

"Pedro" wrote in message
...
Hi,
I have a Filter in a spreadsheet and want to create a code in order to
select each visible row and change its content.
I have visible rows 2,3,4,10,15,50....3560,6550, etc
What code should I write to in order to select each row change its value
and
continue till the end of the visible rows.
Regards
Pedro




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Selecting AutoFilter Rows

then do this:

With ActiveSheet.AutoFilter.Range
If .Columns(1).Cells.SpecialCells(xlCellTypeVisible). Count = 1 Then
MsgBox "no visible cells"
Else
.Columns(1).Cells.SpecialCells(xlCellTypeVisible). Select
End If
End With

KL


"Pedro" wrote in message
...
Thanks

But that will select all the range
I want to select each cell in A column and then change the value of it,
then
it will continue doing it till the end of the shown rows

regards

"KL" wrote:

Pedro,

Look at the reply to your previous post.

KL

"Pedro" wrote in message
...
Hi,
I have a Filter in a spreadsheet and want to create a code in order to
select each visible row and change its content.
I have visible rows 2,3,4,10,15,50....3560,6550, etc
What code should I write to in order to select each row change its
value
and
continue till the end of the visible rows.
Regards
Pedro






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,758
Default Selecting AutoFilter Rows

Are you changing all the values in that visible range in column A to the same
thing?

Option Explicit
Sub Tester03()
Dim rng As Range

With ActiveSheet.AutoFilter.Range
If .Columns(1).Cells.SpecialCells(xlCellTypeVisible). Count = 1 Then
MsgBox "no visible cells"
Else
Set rng = .Resize(.Rows.Count - 1, 1).Offset(1, 0) _
.Cells.SpecialCells(xlCellTypeVisible)
rng.Value = "hi there"
End If
End With
End Sub

This doesn't select anything--it just changes the values.

Or are you changing each cell to a different value?

Option Explicit
Sub Tester03B()
Dim rng As Range
Dim myCell As Range
Dim iCtr As Long

With ActiveSheet.AutoFilter.Range
If .Columns(1).Cells.SpecialCells(xlCellTypeVisible). Count = 1 Then
MsgBox "no visible cells"
Else
Set rng = .Resize(.Rows.Count - 1, 1).Offset(1, 0) _
.Cells.SpecialCells(xlCellTypeVisible)
iCtr = 1
For Each myCell In rng.Cells
myCell.Value = iCtr 'something that changes
iCtr = iCtr + 1
Next myCell
End If
End With
End Sub


Pedro wrote:

Thanks

But that will select all the range
I want to select each cell in A column and then change the value of it, then
it will continue doing it till the end of the shown rows

regards

"KL" wrote:

Pedro,

Look at the reply to your previous post.

KL

"Pedro" wrote in message
...
Hi,
I have a Filter in a spreadsheet and want to create a code in order to
select each visible row and change its content.
I have visible rows 2,3,4,10,15,50....3560,6550, etc
What code should I write to in order to select each row change its value
and
continue till the end of the visible rows.
Regards
Pedro





--

Dave Peterson
Reply
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
HELP: Selecting Non-Visible (Hidden) Cells with AutoFilter Applied west8100 Excel Discussion (Misc queries) 0 February 10th 09 09:28 PM
how to stop/ restart macro after selecting from autofilter list ronnie davidson Excel Discussion (Misc queries) 2 April 6th 06 03:19 PM
Selecting using autofilter cdb Excel Programming 1 September 9th 04 12:38 PM
Selecting Filtered records only when AutoFilter is on Owen Vickers Excel Programming 4 February 21st 04 02:20 AM
Selecting Range After AutoFilter Randal W. Hozeski Excel Programming 4 December 28th 03 03:12 PM


All times are GMT +1. The time now is 06:39 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"