ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macro for searching out side excel?? (https://www.excelbanter.com/excel-programming/368257-macro-searching-out-side-excel.html)

Maria.N[_3_]

Macro for searching out side excel??
 

Hey guyz!
Can some one plz help me out here i need a search macro that can read
read the search string in excel and then search for it out side excel
in another specified location.
I got a search macro from the web can any of you help me modify it cuz
i am a beginner i really dont know macros:(

Search Macro
Public Sub Test()
Dim SR As Integer
Dim ER As Integer
Dim SC As Integer
Dim EC As Integer
Dim RowVar As Integer
Dim ColVar As Integer
Dim found As Boolean

'Change the indexes for your own Row range from 1 to 65536
SR = 1
ER = 20
'Change the indexes for your own Column range from 1 to 256 - in
English from "A" to "IV"
SC = 1
EC = 10
found = False
For RowVar = SR To ER
For ColVar = SC To EC
If Not found Then 'This ensures that you stop at the first
occurrence
If Cells(RowVar, ColVar).Formula = "Angstrom" Then 'This is
where your search text goes
Cells(RowVar, ColVar).Select
found = True
End If
End If
Next
Next
End Sub

Set xlApp = Nothing
End Sub


--
Maria.N
------------------------------------------------------------------------
Maria.N's Profile: http://www.excelforum.com/member.php...o&userid=36235
View this thread: http://www.excelforum.com/showthread...hreadid=564681


Tom Ogilvy

Macro for searching out side excel??
 
what do you mean specifically by search outside Excel

Your macro only has relevance to searching a worksheet and then it is very
inefficent at that.

--
Regards,
Tom Ogilvy


"Maria.N" wrote:


Hey guyz!
Can some one plz help me out here i need a search macro that can read
read the search string in excel and then search for it out side excel
in another specified location.
I got a search macro from the web can any of you help me modify it cuz
i am a beginner i really dont know macros:(

Search Macro
Public Sub Test()
Dim SR As Integer
Dim ER As Integer
Dim SC As Integer
Dim EC As Integer
Dim RowVar As Integer
Dim ColVar As Integer
Dim found As Boolean

'Change the indexes for your own Row range from 1 to 65536
SR = 1
ER = 20
'Change the indexes for your own Column range from 1 to 256 - in
English from "A" to "IV"
SC = 1
EC = 10
found = False
For RowVar = SR To ER
For ColVar = SC To EC
If Not found Then 'This ensures that you stop at the first
occurrence
If Cells(RowVar, ColVar).Formula = "Angstrom" Then 'This is
where your search text goes
Cells(RowVar, ColVar).Select
found = True
End If
End If
Next
Next
End Sub

Set xlApp = Nothing
End Sub


--
Maria.N
------------------------------------------------------------------------
Maria.N's Profile: http://www.excelforum.com/member.php...o&userid=36235
View this thread: http://www.excelforum.com/showthread...hreadid=564681




All times are GMT +1. The time now is 08:51 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com