+ Reply to Thread
Results 1 to 9 of 9

How can I select previous sheet of Sheets("Apple") ?

Hybrid View

HerryMarkowitz How can I select previous... 12-26-2013, 03:22 PM
fredlo2010 Re: How can I select previous... 12-26-2013, 03:27 PM
HerryMarkowitz Re: How can I select previous... 12-26-2013, 03:32 PM
JOHN H. DAVIS Re: How can I select previous... 12-26-2013, 03:32 PM
HerryMarkowitz Re: How can I select previous... 12-26-2013, 03:34 PM
fredlo2010 Re: How can I select previous... 12-26-2013, 03:36 PM
JOHN H. DAVIS Re: How can I select previous... 12-26-2013, 03:42 PM
fredlo2010 Re: How can I select previous... 12-26-2013, 03:44 PM
HerryMarkowitz Re: How can I select previous... 01-11-2014, 04:44 AM
  1. #1
    Forum Contributor HerryMarkowitz's Avatar
    Join Date
    09-10-2012
    Location
    Europe
    MS-Off Ver
    Office 2021 - Win10
    Posts
    1,014

    How can I select previous sheet of Sheets("Apple") ?

    Hi experts,
    Following code is working good;
    Worksheets.Add Before:=Sheets("Apple")
    Following code is not working;
    Worksheets.Select Before:=Sheets("Apple")
    How can I select previous sheet of Sheets("Apple") ?

    Thanks in advance
    Sub DontForgetThese()
         If Your thread includes any code Then Please use code tags...
         If Your thread has been solved Then Please mark as solved...
         If Anybody has helped to you Then Please add reputation...
    End Sub

  2. #2
    Valued Forum Contributor fredlo2010's Avatar
    Join Date
    07-04-2012
    Location
    Miami, United States
    MS-Off Ver
    Excel 365
    Posts
    762

    Re: How can I select previous sheet of Sheets("Apple") ?

    Perhaps something like this:

    on error resume next
    sheets(sheets("Apple").index-1).select
    on error goto 0

    I have the error in case "Apple" is the first sheet.

    Thanks

  3. #3
    Forum Contributor HerryMarkowitz's Avatar
    Join Date
    09-10-2012
    Location
    Europe
    MS-Off Ver
    Office 2021 - Win10
    Posts
    1,014

    Re: How can I select previous sheet of Sheets("Apple") ?

    Thank you fredlo2010. Solved.

  4. #4
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: How can I select previous sheet of Sheets("Apple") ?

    Maybe:

    1

    Sub HerryMarkowitzzzaa()
    Sheets("Apple").Activate
    Sheets.Add
    End Sub
    2
    Sub HerryMarkowitzzza()
    Sheets("Apple").Activate
    ActiveSheet.Previous.Select
    End Sub

  5. #5
    Forum Contributor HerryMarkowitz's Avatar
    Join Date
    09-10-2012
    Location
    Europe
    MS-Off Ver
    Office 2021 - Win10
    Posts
    1,014

    Re: How can I select previous sheet of Sheets("Apple") ?

    This is also good.
    Thanks JOHN H. DAVIS.
    Sub HerryMarkowitzzza()
    Sheets("Apple").Previous.Select
    End Sub

  6. #6
    Valued Forum Contributor fredlo2010's Avatar
    Join Date
    07-04-2012
    Location
    Miami, United States
    MS-Off Ver
    Excel 365
    Posts
    762

    Re: How can I select previous sheet of Sheets("Apple") ?

    Quote Originally Posted by HerryMarkowitz View Post
    This is also good.
    Thanks JOHN H. DAVIS.
    Sub HerryMarkowitzzza()
    Sheets("Apple").Previous.Select
    End Sub
    This is neat!!! thanks for sharing.

  7. #7
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: How can I select previous sheet of Sheets("Apple") ?

    You're both welcome. However, I learned something new with fredlo2010's approach.

  8. #8
    Valued Forum Contributor fredlo2010's Avatar
    Join Date
    07-04-2012
    Location
    Miami, United States
    MS-Off Ver
    Excel 365
    Posts
    762

    Re: How can I select previous sheet of Sheets("Apple") ?

    Quote Originally Posted by JOHN H. DAVIS View Post
    You're both welcome. However, I learned something new with fredlo2010's approach.
    and I with yours

  9. #9
    Forum Contributor HerryMarkowitz's Avatar
    Join Date
    09-10-2012
    Location
    Europe
    MS-Off Ver
    Office 2021 - Win10
    Posts
    1,014

    Re: How can I select previous sheet of Sheets("Apple") ?

    Thanks again.
    Last edited by HerryMarkowitz; 01-11-2014 at 07:04 AM.

+ 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. Find "Apple" in ColB, then count ColC until the next "Total" is found in ColB
    By roothog in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-08-2013, 10:30 PM
  2. Replies: 1
    Last Post: 06-06-2013, 06:28 PM
  3. [SOLVED] How do I convert text ie apple to string "apple" in excel or VBA?
    By dav_mark in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-21-2013, 06:05 PM
  4. Replies: 2
    Last Post: 06-28-2010, 05:26 PM
  5. Replace numbers with Text ("1" to "Apple", for example)
    By pilotwings64 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-07-2008, 06:56 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