#1   Report Post  
Posted to microsoft.public.excel.misc
Mike
 
Posts: n/a
Default How does this work?

Hi everyone,

Say I have this small piece of code:

With Range("G2")
For i = 1 To 30
.Offset(i, ModelCounter) = Range("Picked").Cells(i)
Next
End With

How can this be read please?

Thanks,
Mike

  #2   Report Post  
Posted to microsoft.public.excel.misc
vezerid
 
Posts: n/a
Default How does this work?

This code fills SOME cells in rows 3:32 with the corresponding values
of another range, which was named Picked.
The function Range("G2").Offset(1,3) returns a reference to a cell 1
row below and three columns to the right. Your code snippet does not
show what is the value of variable ModelCounter, so I don;t know in
which column you offset.
The loop

For i = 1 to 30
....
Next

makes i get progressively the values from 1 to 30. Whatever appears
inside the loop will be executed 30 times, with i each time having been
incremented by 1.

Similarly, Range("Picked").Cells(i) will get one more cell from the
range called Picked.

HTH
Kostis Vezerides

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
Dates and Recomended Graphing Programs to work with excel? John Charts and Charting in Excel 2 December 8th 05 07:58 PM
A search for $ in a formula use to work now it does not work JuneJuly Excel Discussion (Misc queries) 2 November 30th 05 10:13 PM
Moving a sheet from one work book to another? WTG Excel Worksheet Functions 1 November 3rd 05 07:12 PM
My links no longer work . . . mike Excel Discussion (Misc queries) 8 October 27th 05 11:59 PM
How to get saved old saved work that was saved over? Maral Excel Discussion (Misc queries) 1 February 20th 05 08:59 PM


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