Hello, my first post so be nice
I more or less started with VBA and Excel yesterday so this might be obvious to most of you but I have been wrestling with this problem for 2 hours now.
What i want to do is use the find-operation on a dynamic number of worksheets, here is my code:
Dim count As Integer
Dim MySheets() As String
Dim Max As Integer
Max = ActiveWorkbook.Worksheets.count
ReDim MySheets(1 To Max)
For count = 1 To Max
MySheets(count) = ActiveWorkbook.Worksheets(count).Name
Next count
FindString = sheets("Search").Range("J10").Value
If Trim(FindString) <> "" Then
With sheets(MySheets).Range("E7:Q33")
And then my find-operation is performed on the range, and that operation works when I type in a specified worksheet to perform it on. The problem is this line of code: With sheets(MySheets).Range("E7:Q33")
It wont allow me to use my array of the names of the worksheets to select those i want to.
Any ideas why I cant?
Thanks! Mike
Bookmarks