do a `down arrow'

L

Larry Levinson

Ok, I can't read ...

Dim year_start As Date, last_row As Integer
year_start = DateValue("1/1/" & Year(Date))
Range("a1").Activate

ActiveSheet.Range("A1").AutoFilter _
Field:=1, _
Criteria1:="<" & year_start

Application.SendKeys ("{DOWN}")

last_row = ActiveCell.row - 1
Selection.AutoFilter

why doesn't this sendkeys ... do a DOWN arrow?


Larry Levinson
Talking up to the vocal ...
LLevinson*Bloomberg.net
(remove the star etc ....)
 
R

Ronald Dodge

Two things I see. First, Activate is for the Workbook and Worksheet level
while Select is for the range level. Therefore, replace your
Range("a1").Activate to Range("A1").Select. I have ran into issues in the
past of Activate not working properly on range objects.

Now, if all you want to do is move the activecell down 1 row, the Offset
Method would do the trick for you.

ActiveCell.Offset(1,0).Select
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top