LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Navigate through selected range to store values...

Need some ideas on how to do this correctly as I'm failing to figure it out.
I have selected a range of cells in a column (using VBA) and want to store
the value in each to a string array.

Set r = Range("Tardy5") 'Tarydy5 is name for range F6:F36
r.Select
n = r.Rows.Count
ReDim arrTardy5Cells(n)

'Loop through selected cells.
'Set curCell = r.Cells(1, i) moved out of the loop below to test.
For i = 1 To n
arrTardy5Cells(i) = ActiveCell.Value 'store value to array
ActiveCell(i, 0).Activate 'expect active cell to advance
down one cell
Next i

The above loop does not behave as I expected it to, so need to know what I'm
missing. Thanks!
 
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
Store range of values in an array Trevor Shuttleworth Excel Programming 6 November 8th 06 06:37 AM
Setting TAB to navigate to selected Cells Only Corey Excel Worksheet Functions 3 May 29th 06 09:54 AM
How do I convert a selected Cell address in a Range to Values? MichaelC Excel Programming 2 June 10th 05 01:44 PM
How to sum Values in selected range? FastOneBaz Excel Programming 4 May 21st 04 09:43 AM
read the values in a range and store them in macro Tom Ogilvy Excel Programming 0 September 13th 03 11:05 PM


All times are GMT +1. The time now is 11:22 PM.

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"