Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
HELP: Selecting Non-Visible (Hidden) Cells with AutoFilter Applied | Excel Discussion (Misc queries) | |||
how to stop/ restart macro after selecting from autofilter list | Excel Discussion (Misc queries) | |||
Selecting using autofilter | Excel Programming | |||
Selecting Filtered records only when AutoFilter is on | Excel Programming | |||
Selecting Range After AutoFilter | Excel Programming |