Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default Increment Columns by 1

Does anyone know how I can increment column references in the range feature
by 1? For example: In my for loop, in the first iteration Range("G" & i
).value = 0, for the next iteration I need it to be Range("H" & i ).value =
0. Any ideas on how to do that? Thanks!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default Increment Columns by 1

use cells instead of range:

for i = 7 to 10
cells(1,i).value = 1
next

would put the value of 1 in row 1 of columns g - j


--


Gary


"NewToVB" wrote in message
...
Does anyone know how I can increment column references in the range feature
by 1? For example: In my for loop, in the first iteration Range("G" & i
).value = 0, for the next iteration I need it to be Range("H" & i ).value =
0. Any ideas on how to do that? Thanks!



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default Increment Columns by 1

Awesome, thank you!

"Gary Keramidas" wrote:

use cells instead of range:

for i = 7 to 10
cells(1,i).value = 1
next

would put the value of 1 in row 1 of columns g - j


--


Gary


"NewToVB" wrote in message
...
Does anyone know how I can increment column references in the range feature
by 1? For example: In my for loop, in the first iteration Range("G" & i
).value = 0, for the next iteration I need it to be Range("H" & i ).value =
0. Any ideas on how to do that? Thanks!




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
Dragging across columns: I want column constant, but row increment CM Excel Worksheet Functions 7 April 30th 23 07:41 PM
Excel Increment columns in rows FGM Excel Discussion (Misc queries) 4 January 3rd 05 04:24 PM
How to Increment columns Glen Mettler[_3_] Excel Programming 1 August 6th 04 10:56 PM
Excel VBA-How do I increment columns in VBA? waveracerr[_5_] Excel Programming 1 February 5th 04 11:37 PM
Excel VBA-How do I increment columns in VBA? waveracerr[_4_] Excel Programming 2 February 5th 04 07:36 PM


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