Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 237
Default Making a Msgbox popup

This code is also from Chip Pearsons website.
The below code sees if a procedure or function is there.
How do I make it to where an input box comes up and then I
type the name of the procedure or sub in and it tell me
the output in a msgbox?

Thanx

Function ModuleExists(ModuleName As String) As Boolean
On Error Resume Next
ModuleExists = Len( _
ThisWorkbook.VBProject.VBComponents(ModuleName).Na me) < 0
End Function
Function ProcedureExists(ProcedureName As String, _
ModuleName As String) As Boolean
On Error Resume Next
If ModuleExists(ModuleName) = True Then
ProcedureExists = ThisWorkbook.VBProject.VBComponents
(ModuleName) _
.CodeModule.ProcStartLine(ProcedureName,
vbext_pk_Proc) < 0
End If
End Function
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default Making a Msgbox popup

Sub testit()
Dim strModuleName As String, strProcedureName As String

strModuleName = InputBox("Module?")
If strModuleName < "" Then
strProcedureName = InputBox("Procedure?")
If strProcedureName < "" Then
MsgBox IIf(ProcedureExists(strProcedureName, strModuleName),
"Exists", "Not Exists")
End If
End If
End Sub


"Todd Huttenstine" wrote in message
...
This code is also from Chip Pearsons website.
The below code sees if a procedure or function is there.
How do I make it to where an input box comes up and then I
type the name of the procedure or sub in and it tell me
the output in a msgbox?

Thanx

Function ModuleExists(ModuleName As String) As Boolean
On Error Resume Next
ModuleExists = Len( _
ThisWorkbook.VBProject.VBComponents(ModuleName).Na me) < 0
End Function
Function ProcedureExists(ProcedureName As String, _
ModuleName As String) As Boolean
On Error Resume Next
If ModuleExists(ModuleName) = True Then
ProcedureExists = ThisWorkbook.VBProject.VBComponents
(ModuleName) _
.CodeModule.ProcStartLine(ProcedureName,
vbext_pk_Proc) < 0
End If
End Function



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default Making a Msgbox popup

Ah thank you. It works!

Todd
-----Original Message-----
Sub testit()
Dim strModuleName As String, strProcedureName As

String

strModuleName = InputBox("Module?")
If strModuleName < "" Then
strProcedureName = InputBox("Procedure?")
If strProcedureName < "" Then
MsgBox IIf(ProcedureExists(strProcedureName,

strModuleName),
"Exists", "Not Exists")
End If
End If
End Sub


"Todd Huttenstine"

wrote in message
...
This code is also from Chip Pearsons website.
The below code sees if a procedure or function is there.
How do I make it to where an input box comes up and

then I
type the name of the procedure or sub in and it tell me
the output in a msgbox?

Thanx

Function ModuleExists(ModuleName As String) As Boolean
On Error Resume Next
ModuleExists = Len( _
ThisWorkbook.VBProject.VBComponents(ModuleName).Na me)

< 0
End Function
Function ProcedureExists(ProcedureName As String, _
ModuleName As String) As Boolean
On Error Resume Next
If ModuleExists(ModuleName) = True Then
ProcedureExists =

ThisWorkbook.VBProject.VBComponents
(ModuleName) _
.CodeModule.ProcStartLine(ProcedureName,
vbext_pk_Proc) < 0
End If
End Function



.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 237
Default Making a Msgbox popup

Is there anyway to break them up where I can input a
module and see if it exists or a procedure instead of both
popup boxes coming up at the same time
-----Original Message-----
Sub testit()
Dim strModuleName As String, strProcedureName As

String

strModuleName = InputBox("Module?")
If strModuleName < "" Then
strProcedureName = InputBox("Procedure?")
If strProcedureName < "" Then
MsgBox IIf(ProcedureExists(strProcedureName,

strModuleName),
"Exists", "Not Exists")
End If
End If
End Sub


"Todd Huttenstine"

wrote in message
...
This code is also from Chip Pearsons website.
The below code sees if a procedure or function is there.
How do I make it to where an input box comes up and

then I
type the name of the procedure or sub in and it tell me
the output in a msgbox?

Thanx

Function ModuleExists(ModuleName As String) As Boolean
On Error Resume Next
ModuleExists = Len( _
ThisWorkbook.VBProject.VBComponents(ModuleName).Na me)

< 0
End Function
Function ProcedureExists(ProcedureName As String, _
ModuleName As String) As Boolean
On Error Resume Next
If ModuleExists(ModuleName) = True Then
ProcedureExists =

ThisWorkbook.VBProject.VBComponents
(ModuleName) _
.CodeModule.ProcStartLine(ProcedureName,
vbext_pk_Proc) < 0
End If
End Function



.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default Making a Msgbox popup

Todd,

Sub testit()
Dim strModuleName As String, strProcedureName As String
Dim blnExists As Boolean

strModuleName = InputBox("Module?")
If strModuleName < "" Then
strProcedureName = InputBox("Procedure?" & vbNewLine & "Leave blank
or cancel to check for module only")
If strProcedureName = "" Then
blnExists = ModuleExists(strModuleName)
Else
blnExists = ProcedureExists(strProcedureName, strModuleName)
End If
MsgBox IIf(blnExists, "Exists", "Not Exists")
End If
End Sub

Rob

"Todd Huttenstine" wrote in message
...
Is there anyway to break them up where I can input a
module and see if it exists or a procedure instead of both
popup boxes coming up at the same time
-----Original Message-----
Sub testit()
Dim strModuleName As String, strProcedureName As

String

strModuleName = InputBox("Module?")
If strModuleName < "" Then
strProcedureName = InputBox("Procedure?")
If strProcedureName < "" Then
MsgBox IIf(ProcedureExists(strProcedureName,

strModuleName),
"Exists", "Not Exists")
End If
End If
End Sub


"Todd Huttenstine"

wrote in message
...
This code is also from Chip Pearsons website.
The below code sees if a procedure or function is there.
How do I make it to where an input box comes up and

then I
type the name of the procedure or sub in and it tell me
the output in a msgbox?

Thanx

Function ModuleExists(ModuleName As String) As Boolean
On Error Resume Next
ModuleExists = Len( _
ThisWorkbook.VBProject.VBComponents(ModuleName).Na me)

< 0
End Function
Function ProcedureExists(ProcedureName As String, _
ModuleName As String) As Boolean
On Error Resume Next
If ModuleExists(ModuleName) = True Then
ProcedureExists =

ThisWorkbook.VBProject.VBComponents
(ModuleName) _
.CodeModule.ProcStartLine(ProcedureName,
vbext_pk_Proc) < 0
End If
End Function



.





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Making a Msgbox popup

Thank you, thats what I wanted.

Todd


-----Original Message-----
Todd,

Sub testit()
Dim strModuleName As String, strProcedureName As

String
Dim blnExists As Boolean

strModuleName = InputBox("Module?")
If strModuleName < "" Then
strProcedureName = InputBox("Procedure?" &

vbNewLine & "Leave blank
or cancel to check for module only")
If strProcedureName = "" Then
blnExists = ModuleExists(strModuleName)
Else
blnExists = ProcedureExists(strProcedureName,

strModuleName)
End If
MsgBox IIf(blnExists, "Exists", "Not Exists")
End If
End Sub

Rob

"Todd Huttenstine"

wrote in message
...
Is there anyway to break them up where I can input a
module and see if it exists or a procedure instead of

both
popup boxes coming up at the same time
-----Original Message-----
Sub testit()
Dim strModuleName As String, strProcedureName As

String

strModuleName = InputBox("Module?")
If strModuleName < "" Then
strProcedureName = InputBox("Procedure?")
If strProcedureName < "" Then
MsgBox IIf(ProcedureExists

(strProcedureName,
strModuleName),
"Exists", "Not Exists")
End If
End If
End Sub


"Todd Huttenstine"


wrote in message
...
This code is also from Chip Pearsons website.
The below code sees if a procedure or function is

there.
How do I make it to where an input box comes up and

then I
type the name of the procedure or sub in and it tell

me
the output in a msgbox?

Thanx

Function ModuleExists(ModuleName As String) As

Boolean
On Error Resume Next
ModuleExists = Len( _
ThisWorkbook.VBProject.VBComponents(ModuleName).Na me)

< 0
End Function
Function ProcedureExists(ProcedureName As String, _
ModuleName As String) As Boolean
On Error Resume Next
If ModuleExists(ModuleName) = True Then
ProcedureExists =

ThisWorkbook.VBProject.VBComponents
(ModuleName) _
.CodeModule.ProcStartLine(ProcedureName,
vbext_pk_Proc) < 0
End If
End Function


.



.

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
popup picture henrik Excel Worksheet Functions 2 October 29th 08 11:27 PM
Popup MsgBox jackle Excel Discussion (Misc queries) 1 February 13th 06 03:44 AM
"Why did we get here????" popup jtwspoon Excel Discussion (Misc queries) 3 February 4th 05 04:57 AM
Are you sure popup box Todd Huttenstine[_2_] Excel Programming 2 November 9th 03 09:38 PM
MsgBox Popup in Excel Danny Legault Excel Programming 1 November 6th 03 02:13 PM


All times are GMT +1. The time now is 06:18 AM.

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

About Us

"It's about Microsoft Excel"