Results 1 to 11 of 11

combine command button and a macro code

Threaded View

anilpatni1234 combine command button and a... 02-03-2018, 01:03 AM
JLGWhiz Re: combine command button... 02-03-2018, 10:51 AM
anilpatni1234 Re: combine command button... 02-04-2018, 12:45 AM
JLGWhiz Re: combine command button... 02-04-2018, 09:25 AM
anilpatni1234 Re: combine command button... 02-04-2018, 09:57 AM
JLGWhiz Re: combine command button... 02-04-2018, 07:44 PM
scottiex Re: combine command button... 02-04-2018, 07:51 PM
anilpatni1234 Re: combine command button... 02-05-2018, 08:27 AM
xlnitwit Re: combine command button... 02-05-2018, 08:33 AM
anilpatni1234 Re: combine command button... 02-05-2018, 08:43 AM
xlnitwit Re: combine command button... 02-05-2018, 08:51 AM
  1. #1
    Forum Contributor
    Join Date
    08-18-2017
    Location
    india
    MS-Off Ver
    2010
    Posts
    490

    combine command button and a macro code

    I have a command button with this code.
    TST is a macro.
    I need to add 2 other macro with this command button.

    The names of the macro are:

    Button2_Click
    Save_Workbook

    How do I do it?

    Private Sub CommandButton2_Click()
    TST
    Dim path As String
    Dim filename1 As String
    Dim filename2 As String
        
    path = "G:\Due\"
    filename1 = Range("C3").Text
    filename2 = Range("Q42").Text
    Application.DisplayAlerts = False
    ActiveWorkbook.SaveAs Filename:=path & filename1 & "-" & filename2 & ".xlsx", FileFormat:=xlOpenXMLWorkbook, Password:="som"
    Application.DisplayAlerts = True
    When i add the macro name as TST the I get this error.

    I have attached the screenshot of it.
    Attached Images Attached Images

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] combine command button and a macro code
    By anilpatni1234 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-30-2018, 12:53 PM
  2. VBA code to create command button. Print all sheets then delete command button.
    By Declamatory in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-15-2015, 05:18 PM
  3. [SOLVED] Code works in macro but not command button
    By datafiend in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-10-2014, 08:06 PM
  4. Macro Command Button: Combine Save As CSV and Delete Unsed Rows Macros
    By mustng_sally in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-15-2013, 10:41 AM
  5. [SOLVED] code behind the command button that runs another macro
    By Vogelmann in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-10-2012, 06:04 AM
  6. Macro to create Command Button and assign code
    By dagindi in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-07-2011, 09:19 AM
  7. Code created in a Macro not working for a Command Button
    By Amber_D_Laws in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 01-13-2006, 06:40 PM

Tags for this Thread

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