PC Review


Reply
Thread Tools Rate Thread

Assigning Macro to Form Button

 
 
JAD
Guest
Posts: n/a
 
      28th Sep 2008
Is there an alternative method to assigning a macro to s form button? The
right click and choose takes a long time when assigning over 200 form
buttons. Any help would be appreciated. Thank You, JAD
 
Reply With Quote
 
 
 
 
JLGWhiz
Guest
Posts: n/a
 
      28th Sep 2008
Do you have 200 individual macros or are you assigning the same one to 200
buttons?

"JAD" wrote:

> Is there an alternative method to assigning a macro to s form button? The
> right click and choose takes a long time when assigning over 200 form
> buttons. Any help would be appreciated. Thank You, JAD

 
Reply With Quote
 
JLGWhiz
Guest
Posts: n/a
 
      28th Sep 2008
Your options with a form button are limited. If you were using a Control
Toolbox button then it is possible to use one button to run one of several
macros using either a select case statement or an If...ElseIf...Then
statement to run a certain macro based on a criteria. It is difficult to
make a good suggestion without more detail of what you are trying to do.

"JAD" wrote:

> Is there an alternative method to assigning a macro to s form button? The
> right click and choose takes a long time when assigning over 200 form
> buttons. Any help would be appreciated. Thank You, JAD

 
Reply With Quote
 
Dave Peterson
Guest
Posts: n/a
 
      28th Sep 2008
You could do it in code, but some way, you'd have to know which buttons get
which macro assigned.

Maybe a table on a worksheet with button names and macro names???

JAD wrote:
>
> Is there an alternative method to assigning a macro to s form button? The
> right click and choose takes a long time when assigning over 200 form
> buttons. Any help would be appreciated. Thank You, JAD


--

Dave Peterson
 
Reply With Quote
 
Dave Peterson
Guest
Posts: n/a
 
      28th Sep 2008
ps. Or if it's the same macro...

You could just use a single button and process the row with the activecell.

JAD wrote:
>
> Is there an alternative method to assigning a macro to s form button? The
> right click and choose takes a long time when assigning over 200 form
> buttons. Any help would be appreciated. Thank You, JAD


--

Dave Peterson
 
Reply With Quote
 
Don Guillett
Guest
Posts: n/a
 
      28th Sep 2008
I can't imagine 200 separate macro buttons but one way of doing this is to
assign all to one macro that uses this idea tied to a table on a worksheet.

Sub vLookupValues()
lr = [a7].End(xlDown).Row
Application.Calculation = xlManual
sn = Application.Caller
x = Application.Match(sn, [SetupA], 0) + 3
'========= Not necessary due to sheet name macro
Sheets("Checks").Shapes(sn).Select
'Selection.Characters.Text = Sheets("setup").Cells(x, 2)
'=======
If Sheets("setup").Cells(x, 2) = "" Then GoTo nomo
Cells(lr, 2) = Sheets("setup").Cells(x, 3)
Cells(lr, 3) = Sheets("setup").Cells(x, 4)
Cells(lr, 4) = Sheets("setup").Cells(x, 5)
Cells(lr, 5) = Sheets("setup").Cells(x, 6)
Cells(lr, 6) = Sheets("setup").Cells(x, 7)
Cells(lr, 7) = Sheets("setup").Cells(x, 8)
Cells(lr, 8) = Cells(lr - 1, 8) + Cells(lr, 4)
Cells(lr, 4).Select
nomo:
Application.Calculation = xlAutomatic
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software
(E-Mail Removed)
"JAD" <(E-Mail Removed)> wrote in message
news:CB2E3C13-BC86-4DF2-915D-(E-Mail Removed)...
> Is there an alternative method to assigning a macro to s form button? The
> right click and choose takes a long time when assigning over 200 form
> buttons. Any help would be appreciated. Thank You, JAD


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Assigning a macro to a button hberg Microsoft Excel Worksheet Functions 1 27th Jan 2010 10:31 PM
Assigning macro to button Zak Microsoft Excel Programming 11 13th Jan 2008 08:15 PM
Assigning a macro to a button =?Utf-8?B?TmlnZWwgRHJpbmt3YXRlcg==?= Microsoft Excel Programming 3 3rd Apr 2006 01:00 PM
Assigning macro to button =?Utf-8?B?ZA==?= Microsoft Excel Misc 0 22nd Aug 2005 01:40 PM
assigning macro to a button =?Utf-8?B?S2VsbHk=?= Microsoft Excel Misc 2 1st Jul 2004 11:11 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:01 PM.