View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
jindon[_54_] jindon[_54_] is offline
external usenet poster
 
Posts: 1
Default Using Range & Cell


Jack Wrote:
I wish to create a macro that will require processing several columns in
an
incremental way.
As far as I can tell, I have 2 options :-
1) Use, for example, Cells(x,colnum) with something like an
increment
counter [e.g. colnum = colnum+1] but then I need to know how to
translate,
say, column CW into a number.
2) Use, for example, Range("CW1") but then how do I increment from CW
to CX
to CY etc.


Help appreciated & many thanks

Jack

Hope this will get you started

Code:
--------------------

Dim y As Long, i As Long
y = Range("CW1").Column
For i = 0 To 10
Cells(x, y + i) = i
Next
' Using Offset
With Range("CW" & x)
For i = 0 To 10
.Offset(, i) = i
Next
End With
--------------------


--
jindon
------------------------------------------------------------------------
jindon's Profile: http://www.excelforum.com/member.php...o&userid=13135
View this thread: http://www.excelforum.com/showthread...hreadid=551315