Thread: Multiple Cells
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Kramer[_2_] Kramer[_2_] is offline
external usenet poster
 
Posts: 3
Default Multiple Cells

I wasn;t really asking about how to refer to a Worksheet. I guess that
I did post it wrong. What I meant to say was this:

OutWorksheet = Worksheets("some name")
CurRow=1
Do While (CurRow <= 1000)
CurCol = 1
Do While (CurCol <=1000)
OutWorksheet.Cells(CurRow, 1) .Value = ComputeValue(CurRow,
CurCol)
CurCol = CurCol + 1
Loop
CurRow = CurRow + 1
Loop

I want to select some of those cells during the iteration, but don't
have good way to select a range. For instance I want to be able to do
something like:
OutWorksheet.Range(CurCol & CurRow & ":" & CurCol + 37 & CurRow +
29).Select

So basically, I'm looking for a way to build a range object given
numerical indices CurCol and CurRow. Any help?


Don Lloyd wrote:
Hi,
Addendum, meant to include in the previous post.

Worksheet.Cells . . . . . . . won't work
If it's the activesheet you can use
Activesheet.Cells . . . . . . . if you want.

Don


"Kramer" wrote in message
oups.com...
Hello. I have a sub that iterates over some cells in my worksheet. So
something like this:







But that that wouldn't work because CurCol is a numeric value not the A
B C ... value that Range expects.

Any idea?