Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Call Sub From InputBox

I have written a macro that will loop through every workbook in a
certain directory. I would like to use that for several other macros
that will do things in the workbooks. Is there a way, I can use an
InputBox to call the routine/sub I want to run with the Loop
procedure?

Thanks in Advance,

JC

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Call Sub From InputBox

On Aug 20, 3:16 pm, "Don Guillett" wrote:
how about
call inputbox("Enter sub to call")

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"John Cole, Jr." wrote in ooglegroups.com...



I have written a macro that will loop through every workbook in a
certain directory. I would like to use that for several other macros
that will do things in the workbooks. Is there a way, I can use an
InputBox to call the routine/sub I want to run with the Loop
procedure?


Thanks in Advance,


JC- Hide quoted text -


- Show quoted text -


Tried that, and I got an error.

JC

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Call Sub From InputBox

Use the brute force approach

Add string names for the function in the test box like
Function1 Function2 Function3

then read input box
FunctionName = inputbox.text

then use a select function to do the call

select case Function Name
Case "Function 1"
call Function1
Case "Function 2"
call Function2
Case "Function 3"
call Function3
end Select

"John Cole, Jr." wrote:

I have written a macro that will loop through every workbook in a
certain directory. I would like to use that for several other macros
that will do things in the workbooks. Is there a way, I can use an
InputBox to call the routine/sub I want to run with the Loop
procedure?

Thanks in Advance,

JC


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Call Sub From InputBox

application.run YourMacroNameVariableHere
(No checking at all!)

But I wouldn't do this. I'd give the user (including me!) a way to run the
procedure that I wanted.

For additions to the worksheet menu bar, I really like the way John Walkenbach
does it in his menumaker workbook:
http://j-walk.com/ss/excel/tips/tip53.htm

Here's how I do it when I want a toolbar:
http://www.contextures.com/xlToolbar02.html
(from Debra Dalgleish's site)

"John Cole, Jr." wrote:

I have written a macro that will loop through every workbook in a
certain directory. I would like to use that for several other macros
that will do things in the workbooks. Is there a way, I can use an
InputBox to call the routine/sub I want to run with the Loop
procedure?

Thanks in Advance,

JC


--

Dave Peterson


  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Call Sub From InputBox

On Aug 20, 5:25 pm, "Don Guillett" wrote:
Sorry. try this
Application.Run InputBox("Enter sub to call")

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"John Cole, Jr." wrote in oglegroups.com...



On Aug 20, 3:16 pm, "Don Guillett" wrote:
how about
call inputbox("Enter sub to call")


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"John Cole, Jr." wrote in
ooglegroups.com...


I have written a macro that will loop through every workbook in a
certain directory. I would like to use that for several other macros
that will do things in the workbooks. Is there a way, I can use an
InputBox to call the routine/sub I want to run with the Loop
procedure?


Thanks in Advance,


JC- Hide quoted text -


- Show quoted text -


Tried that, and I got an error.


JC- Hide quoted text -


- Show quoted text -


....Like a charm.
Thanks a lot!

JC

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
InputBox with VBA Mark[_8_] Excel Discussion (Misc queries) 0 November 24th 08 12:39 AM
InputBox GeorgeJ Excel Discussion (Misc queries) 5 July 12th 07 01:20 AM
Call Center Management: How to calculate 'cost per call' Denniso6 Excel Discussion (Misc queries) 2 June 25th 06 05:01 PM
Inputbox and Application.InputBox Maria[_7_] Excel Programming 1 September 20th 04 11:36 AM
inputbox defj Excel Programming 4 November 26th 03 10:25 PM


All times are GMT +1. The time now is 03:19 PM.

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"