+ Reply to Thread
Results 1 to 2 of 2

Command Button Execute Macro Event Upon Click

  1. #1
    Registered User
    Join Date
    10-14-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    47

    Command Button Execute Macro Event Upon Click

    I have a command button inserted in an excel worksheet. I want my end-user to click on the button to execute an event. The event I want to execute is copy a growing dynamic range of cells from Sheet1 and paste the table in Cell A1 in Sheet2.

    I have created an OFFSET Named Range to count the total number of rows in the vertically growing range in Sheet1 and output that count in Cell A1 of Sheet1. Here is the Sub function I've written to execute the copy paste into Sheet2. The problem - I can't figure out how to execute the event when the commandbutton is clicked...

    Please help!

    My event code:

    Please Login or Register  to view this content.
    Last edited by davesexcel; 10-24-2019 at 02:26 PM.

  2. #2
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,009

    Re: Command Button Execute Macro Event Upon Click

    .
    Right click the button.

    Select ASSIGN MACRO

    Click on the macro name desired.

    Click OK

    Click on button.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Command button to execute macro on click...
    By ruub7 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 05-23-2017, 07:42 AM
  2. How To execute a button (click event) with code?
    By jamiguel77 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-23-2014, 11:22 AM
  3. Stop exit event of textbox firing when click a command button to close a userform
    By chrisjames25 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-18-2013, 09:27 AM
  4. [SOLVED] Is it possible to have a command button click event autofill a textbox within a userform?
    By Orestees in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-16-2012, 02:14 PM
  5. Run command button click event on open
    By slmi1313 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-24-2010, 12:19 PM
  6. [SOLVED] Command Button - On Click Event
    By sharonm in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-27-2006, 08:20 AM
  7. Macro won't execute from a Command Button
    By Dick Scheibe in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 08-20-2005, 08:05 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1