Thread
:
Help! I can't figure this riddle out
View Single Post
#
2
Posted to microsoft.public.excel.programming
jason
external usenet poster
Posts: 104
Help! I can't figure this riddle out
Try this:
Option Base 1
Option Explicit
Private x As Integer
Private y As Integer
Private i As Integer
Private myValue
Private myarray()
Private myStart As Object
Sub xxx()
For x = 1 To 8
For y = 1 To 7
If Cells(y, x) < "" Then
i = i + 1
ReDim Preserve myarray(i)
myarray(i) = Cells(y, x)
End If
Next y
Next x
Set myStart = Application.InputBox("Please enter start location of
results", _ Type:=8)
For i = 1 To UBound(myarray)
myStart(i, 1) = myarray(i)
Next i
End Sub
Does it work? Is it ok?
Jason
(guyinatshirt) wrote in message . com...
I created a spreadsheet inside of which exists a field of 56 data
cells (8x7). These cells track other events that occur throughout the
spreadsheet. Each of the 56 cells will usually equal zero, but at any
given time, up to 8 of the 56 cells at random will hold a value
representing an event that occurred. I need to able to generate a
list of those values in the order they occurred. The seven columns of
the field represent the days of the week, so the proper order would be
a1..a7,b1..b7,etc. The 8 values could be in any of the cells (they
may all occur on the same day.) The resulting list would be an 8 cell
array that holds the values, if any, in order in the uppermost cells,
with the unneeded lower cells blank. Thanks to anyone who can help me
solve this riddle. It sounds so simple, but I can't grasp it.
Reply With Quote
jason
View Public Profile
Find all posts by jason