SearchBar Preferances

Adamguk

New Member
Joined
Jul 12, 2011
Messages
3
Hi All,

I am working on a huge workbook that is controlled by various userforms controlling different worksheets. I want to place on my main userform a search option whereby users can enter a term for example "Project X" and wherever "Project X" appears in any of the sheets the rows are copied and pasted into a new sheet for them. The main blocker to this i have discovered is all my worksheets are hidden with the exception of the worksheet containing the userform. I have seen various variations to the search macro, but cannot find one that searches in 'hidden' sheets?

Any help appreciated. :-)
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
Welcome to MrExcel.

This worked for me if Sheet2 was hidden and one of the cells on it contained Testing:

Code:
Sub Test()
    Dim Rng As Range
    With Worksheets("Sheet2")
        Set Rng = .Cells.Find(What:="Testing", After:=Cells(1, 1), LookIn:=xlFormulas, LookAt _
        :=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
        False, SearchFormat:=False)
    End With
    If Not Rng Is Nothing Then
        MsgBox "Found in " & Rng.Address(False, False) & " on sheet " & Rng.Parent.Name
    End If
End Sub

Of course you can't activate a hidden sheet or a cell on it, but that shouldn't be necessary.
 
Upvote 0
only problem being that macro works on 1 x sheets only. I need one to work through almost 50 sheets
 
Upvote 0

Forum statistics

Threads
1,224,522
Messages
6,179,297
Members
452,903
Latest member
Knuddeluff

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top