Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 6
Default search, copy and paste through multiple sheets

I would like a macro that searches through the same column on multiple pages.
If the hyperlink text in the cell contains the search text it copies and
pastes the hyperlink cell to the main page. Any thoughts where to start?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 915
Default search, copy and paste through multiple sheets

Jeff S. wrote:
I would like a macro that searches through the same column on multiple pages.
If the hyperlink text in the cell contains the search text it copies and
pastes the hyperlink cell to the main page. Any thoughts where to start?


Try the code below. This assumes some things you can figure out looking
at the constant declarations and that results should be pasted on sheet
Main in cell A1 and down.


' ----------------------------------- begin code
Sub CopyHyperlinks()

Const ColToSearch As String = "C:C"
Const SearchTerm As String = "*thing*"

Dim WKS As Worksheet
Dim MyCell As Range
Dim PasteCell As Range

Application.ScreenUpdating = False
Worksheets("Main").Range("A:A").Clear
Set PasteCell = Worksheets("Main").Range("A1")
For Each WKS In ActiveWorkbook.Worksheets
If WKS.Name < "Main" Then
WKS.Activate
For Each MyCell In Application.Intersect _
(Range(ColToSearch), WKS.UsedRange)
If MyCell.Hyperlinks.Count 0 And _
MyCell.Formula Like SearchTerm Then
MyCell.Copy
Worksheets("Main").Activate
PasteCell.Activate
ActiveSheet.Paste
Set PasteCell = PasteCell.Offset(1, 0)
End If
Next MyCell
End If
Next WKS
Application.ScreenUpdating = True
End Sub
' ------------------------------------- end code
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Search, Copy & Paste Formula chanse25 Excel Discussion (Misc queries) 1 March 13th 08 05:44 PM
Search in Multiple Sheets [email protected] Excel Discussion (Misc queries) 4 September 12th 07 10:33 PM
Search, copy and paste help [email protected] Excel Discussion (Misc queries) 0 June 15th 07 02:48 AM
Search, Copy, Paste Macro in Excel [email protected] Excel Worksheet Functions 0 January 3rd 06 06:51 PM
VBA-code for search,copy and paste TUNGANA KURMA RAJU Excel Discussion (Misc queries) 0 December 12th 05 12:40 PM


All times are GMT +1. The time now is 10:50 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"