+ Reply to Thread
Results 1 to 3 of 3

Creating an exception for a macro button.

Hybrid View

  1. #1
    Forum Contributor jonvanwyk's Avatar
    Join Date
    06-28-2010
    Location
    Iowa, USA
    MS-Off Ver
    Excel 2010
    Posts
    452

    Creating an exception for a macro button.

    The macro below is simply a "Next" button that takes the user to the next appropriate worksheet. I need to modify it so that it performs the following function:

    If cell "J18" in worksheet "Menu" is equal to "N/A", then go to cell "F1" in worksheet "Menu", otherwise go to cell "A1" in worksheet "27".


    Sub paycycle27()
    
    ' nexttosheet27 Macro
    
        Sheets("27").Select
        Range("A1").Select
    End Sub
    Last edited by jonvanwyk; 06-20-2012 at 02:17 PM.

  2. #2
    Valued Forum Contributor StevenM's Avatar
    Join Date
    03-23-2008
    Location
    New Lenox, IL USA
    MS-Off Ver
    2007
    Posts
    910

    Re: Creating an exception for a macro button.

    Maybe?

    ' If cell "J18" in worksheet "Menu" is equal to "N/A",
    ' then go to cell "F1" in worksheet "Menu",
    ' otherwise go to cell "A1" in worksheet "27".
    Sub paycycle27()
        If Worksheets("Menu").Range("J18") = "N/A" Then
            Worksheets("Menu").Activate
            Range("F1").Select
        Else
            Worksheets("27").Activate
            Range("A1").Select
        End If
    End Sub

  3. #3
    Forum Contributor jonvanwyk's Avatar
    Join Date
    06-28-2010
    Location
    Iowa, USA
    MS-Off Ver
    Excel 2010
    Posts
    452

    Re: Creating an exception for a macro button.

    Perfect. Thank you.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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