LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default sorting an array


Tom,

Thanks for the help. I figured it out.

BTW: My code for plotting the array on a worksheet is really slow... Any
ideas?

'Plot the values

R1 = 22
R2 = 22
Salary = 22

For a = 1 To UBound(TheArray)

varStart = TheArray(a, 1)
varStop = TheArray(a, 2)
strName = TheArray(a, 3)

If varStart = "" Then GoTo Bottom
If Application.WorksheetFunction.IsText(varStart) = True Then GoTo Bottom

'Determine which side and spacing

intCount = intCount + 1

If Not Lunch Then
If varStart = 0.458 Then
If bolPlotRight Then
R2 = R2 + 2
End If
R1 = R1 + 2
Lunch = True
End If
End If

If Not After Then
If varStart = 0.58 Then
If bolPlotRight Then
R2 = R2 + 2
End If
Salary = R1
R1 = R1 + 12
After = True
End If
End If

If Not Dinner Then
If varStart = 0.708 Then
If bolPlotRight Then
R2 = R2 + 2
End If
R1 = R1 + 2
Dinner = True
End If
End If

If Not Late Then
If varStart = 0.833 Then
If bolPlotRight Then
R2 = R2 + 2
End If
R1 = R1 + 2
Late = True
End If
End If

DayShift:

If R1 = 74 Then
bolPlotRight = True
GoTo PlotRight
End If

PlotLeft:

'Place names and Times
Range("B" & R1).Value = varStart
Range("C" & R1).Value = varStop
Range("D" & R1).Value = strName

R1 = R1 + 2

PlotRight:

If Not bolPlotRight Then GoTo Bottom

'Place names and Times
Range("BE" & R2).Value = varStart
Range("BF" & R2).Value = varStop
Range("BG" & R2).Value = strName

R2 = R2 + 2

Bottom:
Application.StatusBar = "Please wait ... " & Format(intCount / intStatus,
"percent") & " Complete."

Next

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sorting within an array Steve Excel Discussion (Misc queries) 1 May 31st 07 12:49 PM
Array Sorting in VB Randall[_4_] Excel Programming 1 August 24th 04 10:35 PM
Sorting 2D portion of 5D Array ExcelMonkey[_68_] Excel Programming 2 February 4th 04 04:04 AM
Sorting 2D Array ExcelMonkey[_28_] Excel Programming 14 January 28th 04 07:32 PM
Sorting a 2-dimensional array Vasant Nanavati[_2_] Excel Programming 3 July 12th 03 08:27 PM


All times are GMT +1. The time now is 06:28 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"