We have a pop-up....see remarks below
Here are our lines for module 1
____
Sub listum()
With ActiveWorkbook
If .Names.Count > 0 Then
For i = 1 To .Names.Count
MsgBox (i & " " & .Names(i).Name & " " & Range(.Names(i)).Address)
Next
End If
End With
End Sub
Sub main2()
Dim r As Range
Dim rr As Range
Dim s As String
With ActiveWorkbook
c = .Names.Count
If c > 1 Then
For i = c To 1 Step -1
If .Names(i).Name = "GROUP_1" Then
..Names("GROUP_1").Delete
End If
If .Names(i).Name = "GROUP_2" Then
..Names("GROUP_2").Delete
End If
Next
End If
For Each r In Range("GROUP1")
If IsEmpty(r) Then
If rr Is Nothing Then
Set rr = r
Else
Set rr = Union(rr, r)
End If
End If
Next
If rr Is Nothing Then
Else
s = rr.Address(ReferenceStyle:=xlR1C1)
..Names.Add Name:="GROUP_1", RefersToR1C1:="=DYNANAME!" & s
End If
Set rr = Nothing
For Each r In Range("GROUP1")
If Not IsEmpty(r) Then
If rr Is Nothing Then
Set rr = r
Else
Set rr = Union(rr, r)
End If
End If
Next
If rr Is Nothing Then
Else
s = rr.Address(ReferenceStyle:=xlR1C1)
..Names.Add Name:="GROUP_2", RefersToR1C1:="=DYNANAME!" & s
End If
Call listum
End With
End Sub
Sub freeze()
Application.EnableEvents = False
End Sub
Sub thaw()
Application.EnableEvents = True
End Sub
__________________________
Run time Error 1004
Method Range of Object _ Global failed...
when i click "Debug"
VBE open...
highlighted line is...
For your test, if you have time today....here is the workbook detail
Sheetname : DYNANAME
GROUP1 = A1:E5
GROUP_1 = B1:E5 = ALL BLANKS
GROUP_2 = A1:A5 = ALL FILLED IN WITH A VALUE OF 1.
formulas on F6 = sum(GROUP1)....at this moment is = 5
click Tools> SOLVER :
TARGET CELL = F6 : FOR A VALUE OF 26
CHANGING CELL = GROUP_1
CONSTRAINT>ADD>
GROUP_1 >= 1
hit SOLVE...
then Pop-ups will appear, every 4th pop-up you will find the error window..
I believe it is possible cause you did a lot for this sake....
Thanks for not closing this thread....til then..