Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Run a macro by the number typed in a box/button


I want to create a box or button in which I may type a number to run th
associated macro.
For example: My goal is to sort data for each day of the month. I ma
currently create 31 macro's and 31 buttons, but I would like to have on
button/box to run the day that is in need of sorting. I will have 3
macro's, but only one button. Is this possible

--
mcicof
-----------------------------------------------------------------------
mcicoff's Profile: http://www.excelforum.com/member.php...fo&userid=3450
View this thread: http://www.excelforum.com/showthread.php?threadid=54271

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Run a macro by the number typed in a box/button


I know this may be slightly longer winded than just a text box sat o
the screen but hope this helps or at least points in the righ
direction...

Keep your button on the sheet and have it call the Macro "InputBox"
-------------
Sub InputBox()
macro = Application.InputBox("Enter Macro Number")
Run ([macro])
End Sub
------------

Clicking your button will now open an input box which asks for th
macro name you would like to run. If you had a macro called "Print" an
entered Print in this box then that macro would run.

Joh

--
johncassel
-----------------------------------------------------------------------
johncassell's Profile: http://www.excelforum.com/member.php...fo&userid=2501
View this thread: http://www.excelforum.com/showthread.php?threadid=54271

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Run a macro by the number typed in a box/button

How about

Application.Run "Macro" & Day(Date)


--

HTH

Bob Phillips

(remove nothere from the email address if mailing direct)

"mcicoff" wrote in
message ...

I want to create a box or button in which I may type a number to run the
associated macro.
For example: My goal is to sort data for each day of the month. I may
currently create 31 macro's and 31 buttons, but I would like to have one
button/box to run the day that is in need of sorting. I will have 31
macro's, but only one button. Is this possible?


--
mcicoff
------------------------------------------------------------------------
mcicoff's Profile:

http://www.excelforum.com/member.php...o&userid=34504
View this thread: http://www.excelforum.com/showthread...hreadid=542711



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
New Excel doc automatically divides any number typed by ten - Need She_Wizard Setting up and Configuration of Excel 1 December 4th 07 05:13 PM
DATE WRONGLY TYPED IN NUMBER FOMRATE Danish Raj Excel Discussion (Misc queries) 1 September 7th 06 08:45 AM
Inserting a number and having it displayed as you typed Bev New Users to Excel 2 August 23rd 05 01:54 AM
Typed number is always divided by 100 after pressing enter RF dude Excel Discussion (Misc queries) 2 January 28th 05 02:47 AM
Can you Limit the number of caracters that can be typed in a cell? pepperjack[_3_] Excel Programming 3 August 29th 04 03:19 AM


All times are GMT +1. The time now is 09:06 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"