Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
I have dual monitors, how can I view excel workbooks side by side | Excel Worksheet Functions | |||
Excel Pivot Tables-How to put two Data Varibles side by side | Excel Worksheet Functions | |||
excel should cut & paste lists side by side to save paper | Excel Worksheet Functions | |||
can you create a macro to compare two different doc side by side | Excel Worksheet Functions | |||
How to print 2 Excel pages side by side on 1 printed page? | Excel Discussion (Misc queries) |