Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Question to a VBA Wizard!?
Hi,
I have below a piece of VBA code. Everytime the whole code is run, one Excel worksheet named "Constraint" is frozen before "Model.Solve" is called and de-frozen after that within the "JobNr" loop; using ".EnableCalculation". The worksheet, "Constraint", has one cell with RAND() in it. The problem I am getting is described next to the "For JobNr" row loop: Dim JobNr As Integer For JobNr = a To a 'I mean here 1 To 1, 3 To 3,....once at a time 'it works fine 1 To 5 'However, it keeps repeating same reults each time as 'if EnableCalculation is NOT working! Range("B7").Value = JobNr Workbooks(filename).Worksheets("Constraint").Enabl eCalculation = False vehicleModel.Solve line = 1 For Each mac In vehicleModel.Macros rngSolution(JobNr, line).Value = mac.Value line = line + 1 Next mac Workbooks(filename).Worksheets("Constraint").Enabl eCalculation = True Next JobNr What should I do to fix this? Thanks, Mike |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Template Wizard & Database question | Excel Discussion (Misc queries) | |||
Chart Wizard | Excel Discussion (Misc queries) | |||
Allow the use of the fx wizard within the fx wizard for nesting | Excel Worksheet Functions | |||
Question about Query Wizard | Excel Discussion (Misc queries) | |||
Wizard | Excel Discussion (Misc queries) |