Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
do a `down arrow'
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 ....) |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
do a `down arrow'
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 -- Ronald R. Dodge, Jr. Production Statistician Master MOUS 2000 "Larry Levinson" wrote in message ... 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 ....) |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel 2007 - Macro (VB) code for arrow down & arrow up | Excel Discussion (Misc queries) | |||
Using end-arrow down or end-arrow up in a macro | Excel Discussion (Misc queries) | |||
why dont shift+arrow or ctrl+arrow work in 2007 | Excel Discussion (Misc queries) | |||
Arrow key | Excel Discussion (Misc queries) | |||
How to do the following by pressing the down arrow or up arrow key? | Excel Discussion (Misc queries) |