command button

  1. R

    Command Button to send email

    Hello, I have looked through a few of the other threads for this but I have a command button that i want to display an email once the button is clicked. I kep getting an error that says variable not defined. Also in the second image, the two regions of vba keep getting highighted. Overall i am...
  2. Y

    Command Button to Save File Based on Cell Value

    Hi All, I'm hoping for some help please? Ive been trying to create a button in excel that saves the file for the current workbook with the name as cell value and a path (Sharepoint). below is what i have so far, but doesn't work. HELP PLEASE Private Sub CommandButton1_Click() Dim path As...
  3. C

    Border in different sheet

    How to apply border to different sheet after clicking on command button (active control) from different sheet? Here is the code i used Private Sub CommandButton1_Click() With Sheets("GraphReport") Dim LastRow As Long, LastCol As Long Cells.Borders.LineStyle = xlNone LastRow =...
  4. M

    Command Button to paste data to specific Cell of Specific Sheet with matched cell row

    Hi, I have searched in many forums but don't get the best result the suit to my problem. I have two worksheets of a workbook. One is the "Data" and the other is a "Calculation". First Condition: When I select any cell in between Column I8:I1220 of the Data Sheet, the cell value is immediately...
  5. A

    Using a Command Button to add new grouped rows with formatting, formulas, and keeping groups at the end of a growing table?

    Suuuuper fresh to VBA here. I've got a table that has many grouped rows all individually under their main banner row that I use for project management that has multiple rounds per project (hence grouped & banner rows). I am trying to add a "Add New Audit" button that adds a new chunk of rows...
  6. T

    Reference VBA code in new event

    Hi, all, I'm new to VBA coding and, of course, trying an ambitious project (creating my own gradebook in Excel). I haven't got the time to go through an entire VBA course, so I'm turning to the experts for help. While I have a bit of general coding experience (mostly HTML), I'm an absolute...
  7. C

    Inserting formula with a macro

    Hi there, I have tried searching other threads but they were all too old and didn't really answer my problem... I have a command button that when i click it needs to insert a formula into a target cell, i have done this with another button in the same sheet and it works fine but VBA has a...
  8. A

    Delete buttons if they exist

    Hello. I would like delete a button if it exists. I cannot find the syntax that allows for the case where it doesn't exist. I would like something like If “CommandButton1” Exists Then ActiveSheet.Shapes(“CommandButton1”).Delete End If I'm not sure how to write the condition. The Delete part...
  9. S

    add vba code to existing command button code so it will delete only the shapes in a certain range

    I have a simple vba code linked to a command button to clear a range of cells. I would like to add come coding to this to delete a certain shape in the same range of cells. The shape is a: msoAutoShape code: Range("A4:S360").Select...
  10. A

    Unable to insert a separately written code into a command button

    Hi guys, This probably is a very simple question with a very simple solution but I guess I'm too ignorant about VBA yet. I tried copying the below code into a command button but it comes back with an error. I'd love it if you could explain how to solve this problem since I have many of these...
  11. R

    VBA code to send email when two cells in adjacent columns are contain specific data

    I have a code built that, upon clicking a command button, displays an email to a coworker when a cell in column P is "X". When a cell in column P is updated a date stamp is automatically entered into the adjacent cell in column Q. How do I update my code so the email displays only if the...
  12. S

    Date validation on command button

    Hi everyone, I apologise for being noob, I'm new to posting on this forum (even though I've been a member for ages!) I'm having difficulty with validation (not my own btw... Excel's) validation works fine when you enter text into a cell, but it doesn't work when you are working with a user...
  13. csababenyi

    Insert data with VBA command button into password protected sheet

    Hi Guys, I have an excel speradsheet with 22 coulunms and about 1000 rows and growing with lots of macros in it. There is an ADD command button on the main sheet that opens up a VBA scripted table that have drop downs to select data to add to the next row with another ADD DATA button in it. This...
  14. W

    cut and paste with command button into separate locations

    I am trying to cut and paste a row (and keeping the format) to another worksheet and 2 different worksheets in another workbook using a command button for rows in which column K shows a status of "Complete" and automatically save in both locations. In Sheet 1 (Profile Requests in progress) I...
  15. W

    move a row to another sheet and separate workbook based on cell value with button

    I discovered another thread close to something I am trying to do. Automatically move a row to another sheet based on cell value I am trying to do pretty much the same thing but with a button and with the copied data from columns A-M only going to 3 places at once, another sheet in the same...
  16. D

    VBA one cell returns date of last time another cell was edited

    Hello everybody, I currently have the following: Where column: I = quantity J = subtract any number entered from the quantity after which the number entered will be subtracted in column I and disappear in column J so you can enter a new one in the future J = add any number entered from the...
  17. C

    Copy Command Button caption to Clipboard

    Hello everyone. As the title say, I have multiple (at least 10 I think) cmdbuttons on a userform. I have 2 things I am looking to achieve: 1. Copy the cmdbutton captions to clipboard when clicked. This will be pasted on another program like Notepad, etc. 2. Show the cmdbutton captions on...
  18. S

    Command action button

    i need a command action button to sort a table called table1 based on column ”No. Date” from Z to A. it’s important to note that my table increases everyday so the range must not be limited to a certain limit
  19. B

    Refresh the active Private Sub

    Hi, I presently have a number of Private Subs that are triggered by Command Buttons here is an example of two of them 'Security Secret needed If Range("C37") = False And Range("C35") = False And Range("C38") = True And Range("C36") = False Then Range("H13") = Range("AN22")...
  20. F

    Userform command button - Properties

    I was wondering if it was possible to adjust the text property in a userform command button, such that there is less buffer. I have buttons which measure 24x24. In trying to show text clearly the edge distance buffer should be smaller. Can this be programmed using VBA. I am aware of other...
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back