Activate a moacro subroutine from a userform command button

[Excel 2003]

I use macros in a worksheet - for example:

Sub DateStamp()
Range("b14") = Date & " " & Time   'Date And Time
End Sub

I access the macro with a command button in the spreadsheet.

I would now like to access the same code using a command button on a Userform.

I guess I could repeat the same code in the command button on the userform, 
but I would rather not duplicate the code.

Is there a way to do this?

Many thanks,

Roger
0
Utf
11/27/2009 9:06:02 PM
excel.programming 6508 articles. 2 followers. Follow

1 Replies
970 Views

Similar Articles

[PageSpeed] 37

Hi,

Private Sub CommandButton1_Click()
Call DateStamp
End Sub

Mike

"Roger on Excel" wrote:

> [Excel 2003]
> 
> I use macros in a worksheet - for example:
> 
> Sub DateStamp()
> Range("b14") = Date & " " & Time   'Date And Time
> End Sub
> 
> I access the macro with a command button in the spreadsheet.
> 
> I would now like to access the same code using a command button on a Userform.
> 
> I guess I could repeat the same code in the command button on the userform, 
> but I would rather not duplicate the code.
> 
> Is there a way to do this?
> 
> Many thanks,
> 
> Roger
0
Utf
11/27/2009 9:17:01 PM
Reply:

Similar Artilces:

Active Tasks in Outlook Today
Is there a way to only display active tasks in Outlook Today ...

Internal e-mail activities are adding up
As people begin to use CRM and send internal e-mails regarding a particular entity we are seeing a HUGE number of activities adding up. It would be nice in the future if all internal e-mails regarding the entity would be summed up into one activity. ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, follow this link to open the suggestion in the Microsoft Web-based Newsreader and then click "I ...

Command button to replace current record's field
I have a continuous form with a command button in detailed band. On click event, I want to replace 'checkin' field of current record with =now(). Click the command button the 2nd time, replace same field with blank. (toggle). Thanks. To assign the current time to the checkin field, use this code: Me.checkin = Now() (or use the SetValue action in a macro if you prefer.) It would be easier to use another button to blank the field. Code: Me.checkin = Null Otherwise you'll have to keep track of when the button was clicked first (module level variable in the f...

Recurring Service Activities / Items -- CRM 3.0 -- No capability?!
What's the rationale behind *not* having the ability to schedule recurring activities and service items? Have I missed something in workflows or some such? Thanks, ....dgg On May 25, 3:16 pm, David G <David G...@discussions.microsoft.com> wrote: > What's the rationale behind *not* having the ability to schedule recurring > activities and service items? > > Have I missed something in workflows or some such? > > Thanks, > > ...dgg Hi David, Has anyone responded to your question? We are having the same issue and I'm hoping there is a solution avail...

Activity views 09-26-05
Folks When viewing the activities on an account or quote, there appears to be no obvious way to include the date of the activity in the view so it is difficult to determine when the activity was done - resulting in us having to open each and every activity to find the relevant one - and this is time consuming. Any ideas? Regards Gavin The current release of Microsoft CRM does not allow you to customize the activity views at least in a supported fashion. If you scan the archives of this group at groups.google.com for activity view you will find some unsupported methods. Microsoft CR...

Notified Office is Not Activated, but it is Activated
When my boss opens any of his Office 2007 products it notifies him that his copy of office is not activated. It has been activated and when I check it through Options it shows that it is activated, but the dialogue pops up each time the programs are opened. I have used the FixIt from KB 919895 to delete the Opa12.dat file which fixed a communications error in activatation, but the product still doesn't think it is properly activated when it is. ...

Command button to close and return to original form
I have a subform with a command button that will return the user to the main form. However, the subform remains open. I'd like the command button to also close the subform on click. Can anyone help me with the code? Thank you. Sorry Tammy but that does not make too much sense. SubForms are embedded in SubFormControls on other form so I do not see how it could contain a close button that works as you described. Do you mean you have two forms (F1 and F2) and you open F2 from F1 and then close F2 (or try) and F2 remains open? Tammy S. wrote: >I have a subform with a comm...

Email to Activity in queue
Hi, I have created a queue and I don't get any email activity from incoming mail. I have this configuration: - CRM Server: CRM 3 (CRMSERVER) - SQL Server: SQL 2000 sp4 (SQLSERVER) - Exchange Server: Exchange 2003 sp2 Cluster environment (EXCCLU1, EXCCLU2). I have installed the CRM-Email Router in both nodes (http://www.microsoft.com/dynamics/crm/using/deploy/clusteringexchangeservers.mspx) And I have created the queue in two steps: - Step 1: AD Account with Exchange Mailbox o SELF Allow “Associated external account” o CRMEmailEnabled (Custom Attribute...

Set Default View to Active Accounts
How do I set the default view to be Active Accounts for all users? I thought I had set it by going to Settings>Customizations>Customize Entities>Account>Forms&Views>Active Accounts>More Actions>Set Default. I logged out and logged back in and the default view was still set to My Active Accounts. Please Help. -- TC I hope you published the entity after making the change. Try an iisreset... Sam _______________ Inogic Innovative Logic Innovative solutions for your SME ERP/CRM products E-mail: crm@inogic.com Web: www.inogic.com -------------------------- &qu...

The value become wrong when get value by using AppleScript while other worksheet is active.
Version: 2008 Operating System: Mac OS X 10.5 (Leopard) Processor: Intel I just want to send a bug report. Summary: The value become wrong when get value by using AppleScript while other worksheet is active. Description: 1. Create an AppleScript file with below script. tell application "Microsoft Excel" activate set OriginalWorkbook to workbook "Workbook1" set OriginalData to string value of column 1 of row 1 of worksheet 1 of OriginalWorkbook end tell 2. Launch Excel 2008 and create a Workbook called "Workbook1". 3. Enter time data "11...

activate, window activate?
Hi, I want code to fire when I deactive excel and select another program and then run again when I active excel again... Private Sub Workbook_SheetDeactivate(ByVal Sh As Object) Range("v3").Font.ThemeColor = xlAutomatic End Sub Tried several, what am I missing? Try this. Hope this helps! If so, let me know, click "YES" below. Private Sub Workbook_WindowDeactivate(ByVal Wn As Excel.Window) Range("V3").Font.ThemeColor = xlAutomatic End Sub -- Cheers, Ryan "John" wrote: > Hi, I want code to fire when I deactive excel an...

Resolution Activities
I am trying to pull resolution activities and whether they are won or lost? Which field stores this information? The Opportunity has a 'state' and 'staus reason' field - you should find that the State field is what you are looking for the 'status reason' is the 'why' (i.e why you won/lost). Guy. "EricaUW" <EricaUW@discussions.microsoft.com> wrote in message news:74837B1C-40CE-40C5-95A0-DE6D771C9C6E@microsoft.com... >I am trying to pull resolution activities and whether they are won or lost? > Which field stores this information? ...

Changing default from printing Entire Workbook to Active Sheets
In Excel 2007, is there a place to select the data to print? I have a user that when she goes to print a document, the 'print what' section of the print box defaults to 'entire workbook.' She wants it to default to 'active sheets.' Is there a setting in Excel or the Registry that I can edit? Thanks, John ...

Determine cluster mode Active/Active or Active/Passive??
This is a simple question but I'm new to Exchange 2003 clustering. We have 2-node Exc 2003 Ent cluster here at my new job. I need to apply the Daylight Savings patches this weekend and making sure I've got the process down. What I noticed in Cluster Admin is that I have online groups/resources in each cluster. So I have excluster1 and excluster2. If I check Active Groups for each one, they both have both and both are online. Same deal with Active Resources. So does this mean I have an Active/Active setup? Thanks for any info Active/Active = 2 cluster nodes, both hosting 1 Excha...

Quick Campaign creating duplicate activities
When I run a quick campaign for either a contact list or an account list, I get 2 activities per contact or account. It does it for any activity type (e-mail, letter, etc) Has anyone seen this? Does anyone know how (or even where to start) to fix this? If I create a quick campaign for 5 contacts, I would like only 5 activities to be created. Thanks Seems like some how your deployment has duplicate workflow process definition for bulk operation. This definition is created during setup. I dont know how your system might have got into that state. Did you run installation or repair ...

Workflow multiplicate activities
I have created 4 workflows for one entity. Each of them starts when the value of custom picklist has been changed. Each of the workflows has stop line at the end. Unfortunatelly for some picklist options there are 4-5 times more created duplicate activities. Is there somebody, who can tell me what is the reason for that ? Best regards, Omega ...

Mail-merge set as default to create activities?
Hello, After a mail-merge is complete and it asks if you want to create activities for these records, does anyone know if you can get it to default to yes rather then no. My client would like to try and stop people from forgetting to clieck yes! Thanks, Katherine If you have an onpremise deployment then you can go and update the <wwwroot>\tools\mailmerge\trackactivities.aspx page and move the checked option from radio button "radNoTrack" to "radTrack". "K" wrote: > Hello, > > After a mail-merge is complete and it asks if you want to cre...

Missing Toolbar button
I do not have the NEWS button on the GO dropdown. Nor do I have it under Toolbars/customize/commands/GO dropdown to enable adding it to the list. I had it once and put it in the GO dropdown but did not have server info to activate. When I next opened Outlook 2003, it was gone, not to be found in either place. Office help is no help here. Can anyone help? Thanks, Doug To get the News command back, go back to the Programs tab in Control Panel | Internet Options and change the default newsreader to Outlook Express. If OE prompts you to make it your default newsreader the next time...

How can I close multiple activities at once
From a customer I got the question: is it possible to close multiple activities (f.i. 300 phonecall created by a Quick Campaign) at once? They DON'T want to delete them! ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, follow this link to open the suggestion in the Microsoft Web-based Newsreader and then click "I Agree" in the message pane. http://www.microsoft.com/Businesssolutions/Com...

Activate an active workbook with name x
First I do a save as.. for a workbook and get the name via a input box (lets say the name gets queried by 'fname'. How do I later move back to that specific workbook? Something I needed would look like: ActiveWorkbook -with the name of 'fname'.Activate tx Gmick, I think fname is a variable in your program. If so, Workbooks(fname).Activate -- Earl Kiosterud mvpearl omitthisword at verizon period net ------------------------------------------- "Gmick" <gnick@chello.nl> wrote in message news:R6LRc.58621$i7.23416@amsnews05.chello.com... > First I do a sav...

How do I get 2003 Macros and Toolbar Buttons form Excel 2003 to 20
How do I get 2003 Macros and Toolbar Buttons from Excel 2003 to 2007. I can see the macros. I did run Office 2003 tools backup settings tool before our "Upgrade"???). I would sure like to know the benifits. I was working well with 2003. BTW. The genises here managing IT have determined we can not Customize the Quick Access Toolbar. I've just been reading various articles since monday and even I now know some commands and/or functionally are not available in Excell without being able to do this. See this page Scott http://www.rondebruin.nl/qat.htm -- Regards Ron de...

Activation, Registration, New User
I edit and produce the newsletter for my neighborhood association. The association recently purchased a copy of Microsoft Publisher 2007 for me to use in order to facilitate my work. Once I am no longer producing the newsletter for the association, we would like to be able to have the new editor install the software. I have installed and activated the software, but not registered it. I think it should be registered in the name of the association, but how do I do this? How can I ensure that if at some point I stop performing this function for the assocation, they can pass on the softwar...

.pdf file not working in UserForm
SITUATION: want to place a .pdf file in a UserForm so when a user clicks a CommandButton in a worksheet, the UserForm comes up displaying the .pdf file and the user can scroll through the pages. WHAT’S BEEN DONE: 1. UserForm3 created. 2. Adobe AcroPDF1 control inserted/confirmed in UserForm – from Toolbox. 3. CommandButton1 inserted in worksheet. 4. The following code inserted in Module1 [thanks go to Jacob Skaria on MSDN]: Private Sub CommandButton1_Click() With Me.AcroPDF1 .LoadFile "S:\.........\DTM-09-007.pdf" [the ...

Outlook 2003 will not close
Have done something but not sure what and now Outlook will not close. In the Task Manager it is found that Word and Outlook are still running. To get Outlook to run again both processes have to be stopped. Outlook has been taken off the machine and put back again with no change. Any help useful. Thanks. May have found the culprit. Noted that WinFaxPro had put a link into Outlook about sending faxes by email. Removed WinFaxPro - it would not work anyway - and Outlook now shuts down OK. Also removed something called Bulls Eye Network which had installed itself on the computer. Had to ...

Attributes on Associated Activity View
Is it possible to add new attributes on the Activity- Open Acitivity associated view. When I go there, there is no button to create new, and all other attributes are read-only. Thanks. Hi Max, You cannot add new attributes on the Activity. However, you can add it to the individual activities like Email, Task etc. For that you have to launch the individual entity and add it there. Thanks! Manoj -- This posting is provided "AS IS" with no warranties, and confers no rights. "Max" <Max @discussions.microsoft.com> wrote in message news:47840A7E-779F-4AC1-B0AC...