Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() After I run it; the value are placed in a stair step down, as in th next range "F8" starts in "H8" its not right.... I would like to run this: For Each cell In MyRange2 If cell.Value 0 Then myrange.Offset(0, x) = cell.Value x = x + 1 End If Next cell down multiple rows...same for each loop... please help CODE PASTED BELOW Sub Benchmark() Dim myrange As Range Dim x As Integer Dim MyRange2 As Range Dim t As Integer x = 0 For t = 0 To 44 Set MyRange2 = Sheets("appendix").Range("p7:cq7") Set MyRange2 = MyRange2.Offset(t, 0) Set myrange = Sheets("appendix").Range("f7") Set myrange = myrange.Offset(t, 0) For Each cell In MyRange2 If cell.Value 0 Then myrange.Offset(0, x) = cell.Value x = x + 1 End If Next cell Next t Set MyRange2 = Nothing Set myrange = Nothing End Su -- NetWave12 ----------------------------------------------------------------------- NetWave128's Profile: http://www.excelforum.com/member.php...nfo&userid=229 View this thread: http://www.excelforum.com/showthread.php?threadid=27579 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() NetWave182 I think you need to change your code to: For Each cell In MyRange2 If cell.Value 0 Then x = x + 1<<<<<<< Move to here..... myrange.Offset(0, x) = cell.Value End If Next cell Charle -- Charle ----------------------------------------------------------------------- Charles's Profile: http://www.excelforum.com/member.php...nfo&userid=601 View this thread: http://www.excelforum.com/showthread.php?threadid=27579 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Offset(RowOffset,ColumnOffset) not (Column, Row). Hard to say if you have
this backwards or not. -- George Nicholson Remove 'Junk' from return address. "NetWave128" wrote in message ... After I run it; the value are placed in a stair step down, as in the next range "F8" starts in "H8" its not right.... I would like to run this: For Each cell In MyRange2 If cell.Value 0 Then myrange.Offset(0, x) = cell.Value x = x + 1 End If Next cell down multiple rows...same for each loop... please help CODE PASTED BELOW Sub Benchmark() Dim myrange As Range Dim x As Integer Dim MyRange2 As Range Dim t As Integer x = 0 For t = 0 To 44 Set MyRange2 = Sheets("appendix").Range("p7:cq7") Set MyRange2 = MyRange2.Offset(t, 0) Set myrange = Sheets("appendix").Range("f7") Set myrange = myrange.Offset(t, 0) For Each cell In MyRange2 If cell.Value 0 Then myrange.Offset(0, x) = cell.Value x = x + 1 End If Next cell Next t Set MyRange2 = Nothing Set myrange = Nothing End Sub -- NetWave128 ------------------------------------------------------------------------ NetWave128's Profile: http://www.excelforum.com/member.php...fo&userid=2297 View this thread: http://www.excelforum.com/showthread...hreadid=275799 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
OFFSET and LOOKUP Error | Excel Worksheet Functions | |||
Error in Function OFFSET | Excel Worksheet Functions | |||
#REF Error in Named Range with INDIRECT, SUMPRODUCT, and OFFSET | Excel Worksheet Functions | |||
Offset/match returns #value error | Excel Worksheet Functions | |||
Offset delivers value error with Named range | Excel Worksheet Functions |