T
Travis McGee
Have values in a Worksheet Like this Cells 1-4
Module Name | Line No | Sub or Function | Name of the Proc (hundreds of
them)
Module2 135 Sub completeStrengthsForSwiss()
Module1 4117 Function convertDutchAsciToUnicode(ByVal sStr
As String) As String
By clicking on a button on the Worksheet, I want to go to the Module and the
Function.
I can get the code to Activate the Module (proboably Line #1), but going to
the Funcion with Cursor is the part I couldn't do.
I want to do Find
SendKeys is an Application Method, but when you use it against the VBIDE
..... it errors even if the "Module" is active at that time.
When you do Application Method, it works against the Worksheet.
Sub findSelectedFunction()
iRow = ActiveCell.Row
sModule = Cells(iRow, 1): sType = Cells(iRow, 3): sFunction = Cells(iRow, 4)
sFunction = Left(sFunction, InStr(sFunction, "(") - 1)
sName = sType & " " & sFunction
Set wb = ThisWorkbook: Set VBProj = wb.VBProject
VBProj.VBComponents(sModule).Activate .............this one works, it
actually Activates the Moduel that I want in Cell 1
VBProj.VBComponents(sModule).SendKeys("^F") <=========Error here. Find /
Control F
VBProj.VBComponents(sModule).SendKeys("Sub completeStrengthsForSwiss(")
VBProj.VBComponents(sModule).SendKeys("~N") ................. for FindNext
'Set oMod = VBProj.VBComponents(sModule).CodeModule
End Sub
Any other suggestions for moving the Cursor within the modue to a desired
text?
Module Name | Line No | Sub or Function | Name of the Proc (hundreds of
them)
Module2 135 Sub completeStrengthsForSwiss()
Module1 4117 Function convertDutchAsciToUnicode(ByVal sStr
As String) As String
By clicking on a button on the Worksheet, I want to go to the Module and the
Function.
I can get the code to Activate the Module (proboably Line #1), but going to
the Funcion with Cursor is the part I couldn't do.
I want to do Find
SendKeys is an Application Method, but when you use it against the VBIDE
..... it errors even if the "Module" is active at that time.
When you do Application Method, it works against the Worksheet.
Sub findSelectedFunction()
iRow = ActiveCell.Row
sModule = Cells(iRow, 1): sType = Cells(iRow, 3): sFunction = Cells(iRow, 4)
sFunction = Left(sFunction, InStr(sFunction, "(") - 1)
sName = sType & " " & sFunction
Set wb = ThisWorkbook: Set VBProj = wb.VBProject
VBProj.VBComponents(sModule).Activate .............this one works, it
actually Activates the Moduel that I want in Cell 1
VBProj.VBComponents(sModule).SendKeys("^F") <=========Error here. Find /
Control F
VBProj.VBComponents(sModule).SendKeys("Sub completeStrengthsForSwiss(")
VBProj.VBComponents(sModule).SendKeys("~N") ................. for FindNext
'Set oMod = VBProj.VBComponents(sModule).CodeModule
End Sub
Any other suggestions for moving the Cursor within the modue to a desired
text?