Not sure you are setting rng before test? Your code.....
If Sht2 = "Global - " & ConditionSize & " Banks" Then
Set rng = Nothing ' set to nothing after test!
Set rng = Worksheets(Sht2)
If rng Is Nothing Then
Sheets(Sht).Copy After:=Sheets("Assumptions")
Sheets(Sht & " (2)").Name = Sht2
End If
Else:
Sheets(Sht).Copy After:=Sheets("Assumptions")
Sheets(Sht & " (2)").Name = Sht2
End If
would not this work .....
Set rng = Nothing
If Sht2 = "Global - " & ConditionSize & " Banks" Then
Set rng = Worksheets(Sht2)
Else
Sheets(Sht).Copy After:=Sheets("Assumptions")
Sheets(Sht & " (2)").Name = Sht2
End If
--
Regards,
Nigel
"Wesslan" wrote in message
...
Nigel,
The rng is set to nothing already before the tests. Thus if no sheet
is found, there is no problem since rng = nothing.
But if there is a sheet to be found Set rng = Worksheets(Sht2)
becomes True. Thus I want it to not create a new sheet (as it already
exists). However in this case the If rng Is Nothing Then breaks down.
In my world rng is Not Nothing, so it should just proceed without
doing anything. But instead it just breaks down as rng is NOT nothing,
but rather true. weird... ;)
Regards,
Peder