#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 45
Default loop syntax

can someone correct the syntax in the last line below. Thank you

I just want C(24*i+2):C(24*i+25) to be selected. thanx

Dim i As Long
For i = 1 To 1
Range("C" & 24 * i + 2:"C" & 24 * i + 25).Select
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 45
Default loop syntax

nevermind i got it

Range(("C" & 24 * i + 2), ("C" & 24 * i + 25)).Select

thanx

"Knox" wrote:

can someone correct the syntax in the last line below. Thank you

I just want C(24*i+2):C(24*i+25) to be selected. thanx

Dim i As Long
For i = 1 To 1
Range("C" & 24 * i + 2:"C" & 24 * i + 25).Select

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default loop syntax

Maybe:

Range("C" & 24 * i + 2 & ":C" & 24 * i + 25).Select
Or
Cells(24 * i + 2, "C").Resize(24, 1).Select
or
Range("C" & 24 * i + 2).Resize(24, 1).Select

I like the middle one!


Knox wrote:

can someone correct the syntax in the last line below. Thank you

I just want C(24*i+2):C(24*i+25) to be selected. thanx

Dim i As Long
For i = 1 To 1
Range("C" & 24 * i + 2:"C" & 24 * i + 25).Select


--

Dave Peterson
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
Syntax for stopping a Do Loop? bondjel Excel Discussion (Misc queries) 5 March 22nd 10 01:35 PM
"Loop until" syntax question Fastbike[_5_] Excel Programming 4 September 3rd 05 03:16 PM
Advancing outer Loop Based on criteria of inner loop ExcelMonkey Excel Programming 1 August 15th 05 05:23 PM
Problem adding charts using Do-Loop Until loop Chris Bromley[_2_] Excel Programming 2 May 23rd 05 01:31 PM
HELP!!!! Can't stop a loop (NOT an infinite loop) TBA[_2_] Excel Programming 3 December 14th 03 03:33 PM


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