Results 1 to 3 of 3

Vba to open closed tabs in a work book then close them

Threaded View

  1. #1
    Registered User
    Join Date
    02-10-2018
    Location
    toronto ontario
    MS-Off Ver
    office 2010
    Posts
    66

    Vba to open closed tabs in a work book then close them

    Hi all
    I have a bit of a problem with some code I wrote if the tabs sheets are open then the copy move function works fine What I need is to open then close the tabs sheets as it runs
    Hope some one can help me

    Sub Move()
    '
    ' Move all Entries for the next year
    
    
    myCheck = MsgBox("Warning Warning. " & vbCrLf & "This will Move all Data To Past Member and Reset the Master Mem Tab . " & vbCrLf & _
            "Do you wish to continue?", vbYesNo + vbInformation, "Message Box")
        
        If myCheck = vbNo Then Exit Sub
    
    Dim TabName As String
        
        Sheets("Six Year Derby").Select
          Range("B5:S46").Select
          Selection.ClearContents
        
        Sheets("Five Year Derby").Select
          Range("B5:S46").Select
          Selection.Copy
          Sheets("Six Year Derby").Select
        ActiveSheet.Paste
        
        Sheets("Four Year Derby").Select
           Range("B5:S46").Select
           Selection.Copy
           Sheets("Five Year Derby").Select
         ActiveSheet.Paste
        
        Sheets("Three Year Old").Select
           Range("B5:S46").Select
           Selection.Copy
           Sheets("Four Year Derby").Select
         ActiveSheet.Paste
        
        Sheets("Two Year Old").Select
           Range("B5:S46").Select
           Selection.Copy
           Sheets("Three Year Old").Select
         ActiveSheet.Paste
          
        Sheets("Yearling Year").Select
           Range("B5:S46").Select
           Selection.Copy
           Sheets("Two Year Old").Select
        ActiveSheet.Paste
        
        Sheets("Weanling Year").Select
           Range("B5:S46").Select
           Selection.Copy
           Sheets("Yearling Year").Select
        ActiveSheet.Paste
    
    Sheets("Weanling Year").Select
           Range("A5:S46").Select
          Selection.ClearContents
         ActiveCell.Select
            
            Sheets("Weanling Year").Select
         Application.CutCopyMode = False
    End Sub
    Last edited by mmikem; 01-02-2019 at 08:56 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Copy sheet from closed wkbk to any open book, using VBA that's in personal.xls
    By franklin_m in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-22-2017, 01:23 PM
  2. Open Closed Book, carry out a VLookup and then put all entries into blank book
    By AChatwin in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-22-2015, 03:17 AM
  3. [SOLVED] SUMPRODUCT multiple criteria in closed work book
    By DannyJ in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-12-2015, 05:26 PM
  4. Replies: 2
    Last Post: 05-08-2015, 11:21 PM
  5. Data copy Automatically into closed work book
    By rajeev.raj in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-18-2013, 12:25 AM
  6. Replies: 0
    Last Post: 11-13-2011, 06:57 AM
  7. [SOLVED] Open book, check for macros, close book
    By CLR in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 03-31-2005, 02:06 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