Re: Help with OFFSET Problem Please
From: Jim Cone (jim.coneXXX_at_rcn.comXXX)
Date: 02/26/05
- Next message: mexage: "Excel Bug when Debugging (When pressing CTRL+BREAK): keeps stoping"
- Previous message: Greg B...: "Re: Copying row using if function"
- In reply to: Paul Black: "Re: Help with OFFSET Problem Please"
- Next in thread: Paul Black: "Re: Help with OFFSET Problem Please"
- Reply: Paul Black: "Re: Help with OFFSET Problem Please"
- Messages sorted by: [ date ] [ thread ]
Date: Sat, 26 Feb 2005 08:38:30 -0800
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" <Anonymous@Discussions.Microsoft.com> wrote in
message news:eTBBFiBHFHA.3332@TK2MSFTNGP15.phx.gbl...
> 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
- Next message: mexage: "Excel Bug when Debugging (When pressing CTRL+BREAK): keeps stoping"
- Previous message: Greg B...: "Re: Copying row using if function"
- In reply to: Paul Black: "Re: Help with OFFSET Problem Please"
- Next in thread: Paul Black: "Re: Help with OFFSET Problem Please"
- Reply: Paul Black: "Re: Help with OFFSET Problem Please"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|