Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Selecting Range by Count Method 1

Status
Not open for further replies.

Mantle51

Programmer
Aug 17, 2006
97
US
Hello,
I have the following which loops through, adding 1 to count with each iteration, then returns to starting cell and sets range according to count return. Is there a more efficient way to set the range as loop iterates?

Thank you.......Mickey


Do Until ActiveCell(1, 0).Value = TimeT + TestOffset
ActiveCell.Offset(1, 0).Select
Count = Count + 1
Loop
ActiveCell.Offset(-Count, 0).Select
Set rng1 = Range(ActiveCell, ActiveCell.Offset(Count))
 




Hi,

Code:
Set rng = Range(ActiveCell, Activecell.Offset(TimeT + TestOffset - 1))

Skip,

[glasses] [red][/red]
[tongue]
 


Mantle51,

Your moniker seems to indicate that you're a Micky Mantle fan.

I can remember as a kid, growing up in surburban Philadelphia, reading a commemorative glass that my dad had, listing the winners of the World Series -- all those occurrences of The New York Yankees. I hated it! And the Phillies and A's could never seem to rise to the occasion! [hairpull3]

Skip,

[glasses] [red][/red]
[tongue]
 
Well yes I'm fond of previous Yankee dyanasties. I remember getting a '57 Topps Mantle card for my 10th B-day and how I thought it was like finding gold. Philly huh, ever hear of Villanova? That's my alma mater
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top