Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 42
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 111
Default 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
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
Excel 2007 - Macro (VB) code for arrow down & arrow up Grindy Excel Discussion (Misc queries) 5 January 28th 09 04:30 AM
Using end-arrow down or end-arrow up in a macro Richard Champlin Excel Discussion (Misc queries) 2 September 20th 07 01:12 AM
why dont shift+arrow or ctrl+arrow work in 2007 Naguib Excel Discussion (Misc queries) 1 July 24th 07 04:40 PM
Arrow key dpal Excel Discussion (Misc queries) 2 May 2nd 07 06:18 PM
How to do the following by pressing the down arrow or up arrow key? cyberdude Excel Discussion (Misc queries) 4 December 14th 05 01:29 PM


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