Help with OFFSET Problem Please
Paul,
I don't completely understand your code.
However the line...
"ActiveCell.Offset(-100, 5).Select'"
will error if the ActiveCell is in Row 100 or less.
Regards,
Jim Cone
San Francisco, USA
"Paul Black" wrote in message ...
Hi,
I have Two Macros that Work Well Except for One thing.
I want the First Macro to Produce Results in Cells "A1:C100", then Cells
"F1:H100" and then Cells "K1:M100" etc. For this the Code Below Works
Fine :-
For i = 1 To nMaxF - 1
For j = i + 1 To nMaxF
nCount = nCount + 1
If nCount = 101 Then
nCount = 1
ActiveCell.Offset(-100, 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 = nTest1(i, j)
Next j
Next i
The Second Macro is Called from the First Macro and I want to Produce
Results in Cells "D1:D100", then Cells "I1:I100" and then Cells
"N1:N100" etc. For this the Code Below Does NOT Work, it Gives a '1004'
Error :-
For i = 1 To nMaxF - 1
For j = i + 1 To nMaxF
nCount = nCount + 1
If nCount = 101 Then
nCount = 1
ActiveCell.Offset(-100, 5).Select
End If
ActiveCell.Offset(1, 0).Select
ActiveCell.Offset(-1, 3).Value = nTest2(i, j)
Next j
Next i
It is the Above Line .
ActiveCell.Offset(-100, 5).Select
. that is Giving the Error.
If in the Two Macros I Do NOT Use Offset, Everything is Fine.
Any Help will be Appreciated.
All the Best.
Paul
|