Results 1 to 4 of 4

Macro call dependent on value

Threaded View

  1. #2
    Forum Expert JLGWhiz's Avatar
    Join Date
    02-20-2011
    Location
    Florida, USA
    MS-Off Ver
    Windows 10, Excel 2013
    Posts
    2,070

    Re: Macro call dependent on value

    Sub CommandButton3_Click()
        With Sheets("Rota")
            If .Range("M29") = 1 Then
                test1
            ElseIf .Range("M29") = 2 Then
                test2
            ElseIf .Range("M29") = 3 Then
                test3
            ElseIf .Range("M29") = 4 Then
                test4
            End If
        End With
     End Sub
    Be sure your called macros are in one of the numbered code modules for public access.
    Last edited by JLGWhiz; 08-31-2018 at 01:20 PM.
    Any code provided by me should be tested on a copy or a mock up of your original data before applying it to the original. Some events in VBA cannot be reversed with the undo facility in Excel. If your original post is satisfied, please mark the thread as "Solved". To upload a file, see the banner at top of this page.
    Just when I think I am smart, I learn something new!

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Call the next macro if the first macro doesnt return results
    By geliedee in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-20-2016, 06:54 AM
  2. Outlook New_Mail Event Macro to Call Excel Macro
    By christopheralan88 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-29-2015, 06:28 PM
  3. Replies: 0
    Last Post: 03-26-2015, 12:07 AM
  4. Replies: 2
    Last Post: 08-13-2014, 06:39 PM
  5. Replies: 1
    Last Post: 08-13-2014, 05:46 PM
  6. Calling macro 10 times, add header list to macro call only once
    By capson in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-05-2013, 09:42 AM
  7. Replies: 4
    Last Post: 04-17-2013, 03:28 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