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: 181
Default Another ARRAY Question...

Is it possible to set a range as an array using the ("A1:A10") style, or 2
named ranges such as("firstRecord:lastRecord") rather than typing each cell
in ("A1","A2","A3"...etc)?

Also, since this array will change each time the sheet is used, is it
possible to count the number of values that appear in the array to use in a
For, Next loop?

I'm basically moving data if a cell contained in the array contains an 'x'

code below if any help.

Thanks

Trevor

Sub Converted()

myRows = Worksheets("Tracker").Range("first_entry:last_entr y").Rows.Count
MyValues = Array("D6", "D7", "D8", "D9", "D10")

For i = 0 To myRows - 1

If Worksheets("Tracker").Range(MyValues(i)) = "x" Then
Worksheets("Tracker").Range("B6:c6").Offset(i, 0).Copy
Range("last_test").Select
Selection.End(xlUp).Select
ActiveCell.Offset(1, 0).Range("A1").Select
Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats
End If

Next i

End Sub
 
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
Array Question keeblerjp Excel Discussion (Misc queries) 4 June 20th 06 04:21 PM
For Each Array Question mvyvoda Excel Programming 1 June 12th 06 06:34 PM
Array Question Frederick Chow Excel Programming 3 March 10th 05 06:16 PM
Array question mickiedevries[_9_] Excel Programming 3 August 24th 04 06:58 PM
Array Question hotherps[_88_] Excel Programming 2 July 30th 04 11:26 AM


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