Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 32
Default Using end-arrow down or end-arrow up in a macro

I created a macro to gather a short list of data items for some numbers that
are in 3 different spreadsheets (all identical, just a different series of
numbers on each).

I started the macro by telling it to go to a hard location in the first
spreadsheet (where the list of numbers starts), then end-arrow down to the
last number, then over to the next column where I have a vlookup function.
Each day, the list on each spreadsheet may be shorter or longer, depending on
which numbers are chosen.

My macro unfortunately uses the same quantity of numbers on each spreadsheet
each time, remembering the number of rows down when first created.

How can I alter it so that it knows to stop at the last number in the list,
regardless of how many are in the list, and be able to do it again when the
list becomes shorter or longer?
--
Richard Champlin
Administrative Program Assistant II
Children''''''''s Hospital & Regional Medical Center, Seattle
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,939
Default Using end-arrow down or end-arrow up in a macro

Post your code...
--
HTH...

Jim Thomlinson


"Richard Champlin" wrote:

I created a macro to gather a short list of data items for some numbers that
are in 3 different spreadsheets (all identical, just a different series of
numbers on each).

I started the macro by telling it to go to a hard location in the first
spreadsheet (where the list of numbers starts), then end-arrow down to the
last number, then over to the next column where I have a vlookup function.
Each day, the list on each spreadsheet may be shorter or longer, depending on
which numbers are chosen.

My macro unfortunately uses the same quantity of numbers on each spreadsheet
each time, remembering the number of rows down when first created.

How can I alter it so that it knows to stop at the last number in the list,
regardless of how many are in the list, and be able to do it again when the
list becomes shorter or longer?
--
Richard Champlin
Administrative Program Assistant II
Children''''''''s Hospital & Regional Medical Center, Seattle

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 32
Default Using end-arrow down or end-arrow up in a macro

'
Range("B2").Select
Application.Goto Reference:="R3C16"
Selection.End(xlDown).Select
Selection.End(xlDown).Select
Selection.End(xlUp).Select
Range("Q12").Select
Range(Selection, Selection.End(xlUp)).Select
Selection.Copy
Windows("Book1").Activate
Range("A1").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Selection.End(xlDown).Select
Range("A11").Select
Windows("Cost Listing.xls").Activate
ActiveSheet.Next.Select
Range("B2").Select
Application.Goto Reference:="R3C16"
Range("P4").Select
Selection.End(xlDown).Select
Selection.End(xlDown).Select
Selection.End(xlUp).Select
Range("Q10").Select
Range(Selection, Selection.End(xlUp)).Select
Selection.Copy
Windows("Book1").Activate
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Selection.End(xlDown).Select
Range("A19").Select
Windows("Cost Listing.xls").Activate
ActiveSheet.Next.Select
Range("B2").Select
Application.Goto Reference:="R3C16"
Selection.End(xlDown).Select
Selection.End(xlDown).Select
Selection.End(xlUp).Select
Range("Q4").Select
Range(Selection, Selection.End(xlUp)).Select
Selection.Copy
Windows("Book1").Activate
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Range("A1:A20").Select
Selection.Style = "Currency"
Selection.NumberFormat = "$#,##0.00_);[Red]($#,##0.00)"
End Sub

--
Richard Champlin
Administrative Program Assistant II
Children''''''''s Hospital & Regional Medical Center, Seattle


"Jim Thomlinson" wrote:

Post your code...
--
HTH...

Jim Thomlinson


"Richard Champlin" wrote:

I created a macro to gather a short list of data items for some numbers that
are in 3 different spreadsheets (all identical, just a different series of
numbers on each).

I started the macro by telling it to go to a hard location in the first
spreadsheet (where the list of numbers starts), then end-arrow down to the
last number, then over to the next column where I have a vlookup function.
Each day, the list on each spreadsheet may be shorter or longer, depending on
which numbers are chosen.

My macro unfortunately uses the same quantity of numbers on each spreadsheet
each time, remembering the number of rows down when first created.

How can I alter it so that it knows to stop at the last number in the list,
regardless of how many are in the list, and be able to do it again when the
list becomes shorter or longer?
--
Richard Champlin
Administrative Program Assistant II
Children''''''''s Hospital & Regional Medical Center, Seattle

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
why dont shift+arrow or ctrl+arrow work in 2007 Naguib Excel Discussion (Misc queries) 1 July 24th 07 04:40 PM
How to add an arrow Box666 New Users to Excel 1 March 8th 07 11:41 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
how to use shift and down arrow keys in a macro? John W Excel Worksheet Functions 1 July 31st 05 01:21 AM
Excel 2003 Macro ignores Arrow Keystrokes tss4info Excel Discussion (Misc queries) 0 May 5th 05 08:17 AM


All times are GMT +1. The time now is 04:12 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"