LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 41
Default Using VBA: Trying to write new solutions ONLY

Hi,

I have this piece of VBA code. I want to write new solutions only as I
am running the solver 50 times for example. See explanations in the
code with questions (each solution is an array of values not single
value):

Dim rng As Range
Dim cella As Range
Dim cell1 As Range
Dim i As Long
Dim cnt As Long
Dim bDup As Boolean

If Not IsEmpty(Cells(10, 3)) Then
' 1st value of 1st solution array is in cell (10,3)

Set rng = Range(Cells(10, 3), Cells(59, 3).End(xlUp))
' 1st solution array starts in cell(10,3), and the 50th solution array
starts
' at cell(59,3)

For Each cella In rng
i = 0
cnt = 0
bDup = False

For Each cell1 In cella.Resize(10, 10)
'each solution array has 10 values

For Each mac In vehicleModel.Macros
solutionArray(i) = mac.Value
' How do you define solutionArray as an array?

If cell1.Value = solutionArray(i) Then
cnt = cnt + 1
End If
Next mac
i = i + 1
Next
If cnt = 10 Then
bDup = True
Exit For
End If
Next
End If
If Not bDup Then
' write array

Help to make this VBA code work would be greatly appreciated.

Mike
 
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
IF formula with many solutions. Jaime.CIS New Users to Excel 5 December 7th 06 08:25 PM
lookup & match solutions ieatboogers Excel Worksheet Functions 0 November 16th 05 11:32 PM
VBA to write Unique Solutions ONLY? Michael[_27_] Excel Programming 3 May 22nd 04 05:41 PM
Using VBA, how to write unique solutions only? Michael[_27_] Excel Programming 0 May 6th 04 04:27 PM
Looking for Solutions Tony Johnson Excel Programming 6 August 14th 03 03:03 PM


All times are GMT +1. The time now is 08:38 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"