Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Code to find code
Hi,
What's the code to find a code? I would like to be able to click a button and it will take me to a particular code in the vba viewer Thanks |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Code to find code
Try something like the following.
Sub AAA() Dim FindWhat As String Dim StartLine As Long Dim EndLine As Long Dim StartCol As Long Dim EndCol As Long Dim Found As Boolean With Application.VBE If .ActiveCodePane Is Nothing Then MsgBox "No Code Pane Active" Exit Sub End If With .ActiveCodePane FindWhat = "findme" StartLine = 0 EndLine = .CodeModule.CountOfLines StartCol = 0 EndCol = 0 Found = .CodeModule.Find( _ target:=FindWhat, _ StartLine:=StartLine, _ startcolumn:=StartCol, _ EndLine:=EndLine, _ endcolumn:=EndCol, _ wholeword:=False, _ MatchCase:=False, _ PatternSearch:=False) If Found = True Then .SetSelection StartLine, StartCol, EndLine, EndCol Else MsgBox "Not Found" End If End With End With End Sub -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting www.cpearson.com (email on the web site) "D." wrote in message oups.com... Hi, What's the code to find a code? I would like to be able to click a button and it will take me to a particular code in the vba viewer Thanks |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Code to find code
Thanks Chip,
That seems like quite a long code, Maybe I should have worded it differently What's the code to go to a code, , I have seen sample workbooks, with a button, ie:Click here to view code Of course now that I want to use that type of code I can't find any of those workbooks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Find last row code | Excel Discussion (Misc queries) | |||
How do I find a code in Excel | Excel Worksheet Functions | |||
Convert a Number Code to a Text Code | Excel Discussion (Misc queries) | |||
Why code for find() is not working | Excel Discussion (Misc queries) | |||
copying vba code to a standard code module | Excel Discussion (Misc queries) |