Thread
:
Problems Defining Object Variable in For Each Loop
View Single Post
#
6
Posted to microsoft.public.excel.programming
Tushar Mehta
external usenet poster
Posts: 1,071
Problems Defining Object Variable in For Each Loop
Inside the loop whereever you want to refer to the comments (or
usedrange) for the sheet associated with the loop, use sh.Comments (or
sh.UsedRange). Now, you can safely throw away ObjCollArray.
--
Regards,
Tushar Mehta
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions
In article ,
says...
I think my problem is that my array says:
Private Sub OKButton_Click()
Set ObjCollArray(0) = ActiveSheet.Comments
Set ObjCollArray(1) = ActiveSheet.UsedRange
Set ObjCollArray(2) = ActiveSheet.UsedRange
Set ObjCollArray(3) = ActiveSheet.UsedRange
Set ObjCollArray(4) = ActiveSheet.UsedRange
Set ObjCollArray(5) = ActiveSheet.UsedRange
I then reference these within a For Each sheet Loop which
loops through specific sheets. I am not sure how to set
this up differently do that it works.
{snip}
Reply With Quote
Tushar Mehta
View Public Profile
Find all posts by Tushar Mehta