View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
voodooJoe voodooJoe is offline
external usenet poster
 
Posts: 43
Default I'm not even sure this is possible anymore!

that's pretty bizarre. did it to me too.

first i thought it may be the differing rows in the 3 areas, but no. i'm
really not sure what to do.

when you check the number of rows in rng, it returns 15 - the rows in area 1
of the range.
i guess you need to sum rows in all 4 areas then loop through all 4 areas
with the aydata loop nested inside

sorry, stumped and limited time today
-vdj

"grahamhurlburt"
<grahamhurlburt.218tsm_1136601602.6527@excelforu m-nospam.com wrote in
message news:grahamhurlburt.218tsm_1136601602.6527@excelfo rum-nospam.com...

Thanks voodooJoe, you're script works perfectly on the table examples!
Sorry I didn't give you more info.. I thought someone would just point
me in the right direction and give me a kick..I was really excited to
see a working script made up!

However, putting it into action on the actual spreadsheet has created
some issues..you guys seem to know everything tho..

The ranges for the actual tables are B18:D32, B52:D83, B104:D135.
There is a bunch of other stuff in between the tables, merged cells and
whatnot.. Here is the script I am using, it keeps dropping the rows from
the second and third tables..any ideas?

Sub X()

'id your range
Set rng = Range("B18:D32,B52:D83,B104:D135")

'set range values to array & clear the range
'the values are in the array
aydata = rng
rng.ClearContents

'this will track where to put the data
desrow = 1

'loop thru the array
For i = LBound(aydata) To UBound(aydata)
'if the value in the 3rd column is not equal to zero
If aydata(i, 3) < 0 Then
'write the row to the spreadsheet
For j = 1 To 3
rng.Cells(desrow, j) = aydata(i, j)
Next j
'skip to next row UNLESS this is the 4th row in the block, then skip 2
rows
If desrow / 15 = Int(desrow / 15) Then desrow = desrow + 20 Else desrow
= desrow + 1

End If

Next i

End Sub


--
grahamhurlburt
------------------------------------------------------------------------
grahamhurlburt's Profile:
http://www.excelforum.com/member.php...o&userid=29878
View this thread: http://www.excelforum.com/showthread...hreadid=498835