Down one cell at a time
Thank you both! I will be sure to try both of your
solutions ASAP!
-----Original Message-----
Tom Ogilvy gave me this code to increment down one cell
at a time in a
single column on a filtered sheet. I have this as a
separate macro and
insert a call to it when I need to go down a cell. It
works great for me.
Ed
Sub Increment1()
Dim rng As Range, rng1 As Range
Dim icol As Long
icol = ActiveCell.Column
Set rng = ActiveSheet.AutoFilter.Range
Set rng = Intersect(rng, Columns(icol))
Set rng = Range(ActiveCell.Offset(1, 0), rng(rng.Count))
On Error Resume Next
Set rng1 = rng.SpecialCells(xlVisible)
On Error GoTo 0
If Not rng1 Is Nothing Then
rng1(1).Select
End If
End Sub
"WCyrek" wrote in
message
...
Hi im having problems programming a small function that
will go down one cell at a time comparing the cell to
previous one. My problems stems from trying to get the
range to move one cell down. I tried using
SendKeys "{DOWN}" but it cuases the application to just
hang. Changign the range select by interval of 1 won't
cut
it becuase I use this in spreedsheets where I often
filter
many rows so row 1 can be next to row 2000, looking for
row 2 column A won't help me. Does anyone know why
SendKeys "{DOWN}" won't work? Or is there a better way
to
get the program to move down one cell at a time? Note I
tried usign Enter key instead of Down Arrow aswell, that
didnt help either.
.
|