Results 1 to 5 of 5

Save one sheet, and save work book as back up

Threaded View

  1. #1
    Registered User
    Join Date
    04-30-2014
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    4

    Exclamation Save one sheet, and save work book as back up

    Hi, I have macro code below.

    Currently it saves the work book as separate file (as back up).

    The file has three sheets. (Tip Calculator, Daily Payroll, Two Weeks Payroll).

    I want to be able to save (overwrite to current file) the "Two Weeks Payroll" Sheet only when I click the Macro Button.

    Can you help me? Thanks!


    -------------------------------------------------------------
    Sub Button1_Click()
     '   Local Variables
        Dim rngCDest        As Range
          
        If Worksheets("Two Weeks Payroll").Range("B1") = "" Then
            Worksheets("Two Weeks Payroll").Range("B1:B62") = Worksheets("Daily Payroll").Range("F1:F62").Value
        Else
            Worksheets("Two Weeks Payroll").Range("P1").End(xlToLeft).Offset(0, 1).Range("A1:A62") = Worksheets("Daily Payroll").Range("F1:F62").Value
        End If
         
        If Worksheets("Two Weeks Payroll").Range("M2") <> "" Then
            MsgBox "Two Weeks Payroll is Full. Please Go to Two Weeks Payroll Tap, and click the reset button"
        End If
        
    ' Setup path and file name format
    fPath = ThisWorkbook.Path & "\"
    fName = Format(Date - 1, "yyyymmdd")
    ThisWorkbook.SaveAs fPath & fName
         
        MsgBox "Saved"
        
    End Sub
    Last edited by JBeaucaire; 05-03-2014 at 04:05 AM. Reason: Added missing CODE tags. Please read and follow the Forum Rules, link above in the menu bar. Thanks.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Help Neded! Automatic save and shut down off work book!
    By dgavranovic in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-24-2014, 01:53 PM
  2. Replies: 6
    Last Post: 02-04-2013, 02:18 AM
  3. How to extract a particular data from Multiple work book and save it to single sheet/
    By Swapnanjali in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-28-2013, 05:17 AM
  4. unable to change the data and save the Work Book
    By jay11 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-22-2010, 01:39 PM
  5. Replies: 2
    Last Post: 04-20-2005, 09: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