I met this several times recently, and I was just curious if there was an easier way to do this ...
With Activeworkbook
'Do Stuff
With .Sheets(1)
'More stuff Done
'...
'But now I need to refer to or pass the Sheet in the last With Statement
SomeFunctionAnswer = SomeFunction Activeworkbook.Sheets(1)
End With
'Yet more stuff Done
End With
Should it be completely written out, or is there a way to notify him, which makes it easier / cleaner? Perhaps there is some way or way to transfer yourself only for this instance? What about referencing a property or method from a higher c?
SomeFunctionAnswer = SomeFunction .Self '???
'OR
SomeFunctionAnswer = SomeFunction .Parent.Name '???
Hope this makes sense ...
source
share