Hello all,
I resurrected an old function someone here helped me build a few years ago but doesn't seem to work in Office 2007. Basically I have a button in a Search tab with this code attached, then I simply enter text into a field (J1) and hit the button.
It will then search a different tab (Issues) in the sheet, then come back with only the rows that match my search criteria, in effect grepping the Search tab to only show stuff from the Issues tab which matches the search term.
It works in 2007 compatibility mode but does not work in 2007 normal mode. Specifically, in 2007 compatibility mode in the old spreadsheet it works fine, and can display an unlimited number of rows. In 2007 normal mode, in the new spreadsheet, it only ever shows 1 row. I need it to show unlimited rows like it used to.
Does anyone know what I should change in the sub so I don't have to tell everyone to use it in compatibility mode? Thanks!
Here's the sub code:
I resurrected an old function someone here helped me build a few years ago but doesn't seem to work in Office 2007. Basically I have a button in a Search tab with this code attached, then I simply enter text into a field (J1) and hit the button.
It will then search a different tab (Issues) in the sheet, then come back with only the rows that match my search criteria, in effect grepping the Search tab to only show stuff from the Issues tab which matches the search term.
It works in 2007 compatibility mode but does not work in 2007 normal mode. Specifically, in 2007 compatibility mode in the old spreadsheet it works fine, and can display an unlimited number of rows. In 2007 normal mode, in the new spreadsheet, it only ever shows 1 row. I need it to show unlimited rows like it used to.
Does anyone know what I should change in the sub so I don't have to tell everyone to use it in compatibility mode? Thanks!
Here's the sub code:
Code:
Sub test()
Application.ScreenUpdating = False
ActiveSheet.Range("a2:t1000").Clear
With Sheets("Issues").UsedRange '<----- change to sheet name that contains the data
Set c = .Find(Range("J1").Value, LookIn:=xlValues) '<----- "*a*" can be replaced with a range reference (this is search value)
If Not c Is Nothing Then
firstaddress = c.Address
Do
c.EntireRow.Copy Sheets("Search").Range("A" & Rows.Count).End(xlUp).Offset(1) '<-----change to sheet name that you want to return the data to
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address <> firstaddress
End If
End With
End Sub
Last edited: