View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Jim Cone Jim Cone is offline
external usenet poster
 
Posts: 3,290
Default Help with OFFSET Problem Please

Paul,

Move the ActiveCell.Select statement to the bottom and
change all the "-1" values to 0. The following appeared
to work for me...
'----------------------------
Sub TestAgain()
Dim nMaxF As Long
nMaxF = 10
Dim i As Long
Dim j As Long
Dim nCount As Long

For i = 1 To nMaxF - 1
For j = i + 1 To nMaxF
nCount = nCount + 1
If nCount = 65001 Then
nCount = 1
ActiveCell.Offset(-65000, 5).Select
End If
ActiveCell.Value = i
ActiveCell.Offset(0, 1).Value = j
ActiveCell.Offset(0, 2).Value = nNoB(i, j)
ActiveCell.Offset(0, 3).Value = nB(i, j)
ActiveCell.Offset(1, 0).Select
Next j
Next i
End Sub
'---------------------------------
Regards,
Jim Cone
San Francisco, USA


"Paul Black" wrote in
message ...
Not to Worry, I have Managed to Sort it Out.
One Question though, How can I get it to Start the Output in "A1"
WITHOUT Using a Minus in the Offset Please.
Snippet of Code Used for the Offset.
For i = 1 To nMaxF - 1
For j = i + 1 To nMaxF
nCount = nCount + 1
If nCount = 65001 Then
nCount = 1
ActiveCell.Offset(-65000, 5).Select
End If
ActiveCell.Offset(1, 0).Select
ActiveCell.Offset(-1, 0).Value = i
ActiveCell.Offset(-1, 1).Value = j
ActiveCell.Offset(-1, 2).Value = nNoB(i, j)
ActiveCell.Offset(-1, 3).Value = nB(i, j)
Next j
Next i
If I Don't Use the Minus it Starts the Output from Cell "A2".
Thanks in Advance.
All the Best.
Paul