+ Reply to Thread
Results 1 to 5 of 5

Help with duplicate sheets using VBA

  1. #1
    Registered User
    Join Date
    04-14-2012
    Location
    saudi arabia
    MS-Off Ver
    Excel 2007
    Posts
    15

    Help with duplicate sheets using VBA

    Hi Guys,

    I am seeking your help to create a VBA code to do the following:

    The file has two sheets: "Main" sheet, and "Food January" Sheet

    1- copy all the information of "Food January" sheet (including formulas,format).
    2- Create another sheet called "Food February", and paste the information there.
    3- Create a hyperlink for "Food February" sheet at Main sheet.

    Thank you.

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Help with duplicate sheets using VBA

    Try this
    Please Login or Register  to view this content.
    Copy the Excel VBA code
    Select the workbook in which you want to store the Excel VBA code
    Hold the Alt key, and press the F11 key, to open the Visual Basic Editor
    Choose Insert | Module
    Where the cursor is flashing, choose Edit | Paste

    To run the Excel VBA code:
    Choose View | Macros
    Select a macro in the list, and click the Run button.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  3. #3
    Registered User
    Join Date
    04-14-2012
    Location
    saudi arabia
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: Help with duplicate sheets using VBA

    Thank you very much Arlette

  4. #4
    Registered User
    Join Date
    04-14-2012
    Location
    saudi arabia
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: Help with duplicate sheets using VBA

    Sorry I forgot to mention that after creating the hyperlink I want to copy all date of sheet "Food January" and paste special values at the same sheet.

    I tried the following but obviously it didn't work:

    worksheets("Food January").copy worksheets("Food January").PasteSpecial (xlPasteValues)

  5. #5
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Help with duplicate sheets using VBA

    Pastespecial does not work when you put it in the same line. Try this
    Please Login or Register  to view this content.

+ 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