Results 1 to 2 of 2
  1. #1
    3 Star Lounger
    Join Date
    Nov 2002
    Thanked 0 Times in 0 Posts

    Importing an exported WorkSheet (2000 - 2007)

    When I export a Worksheet it saves it as a cls file and importing it adds it as a class module. Is there a way to copy a sheet, its content and code to another Excel workbook other than cut and paste? Thank you.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Thanked 28 Times in 28 Posts

    Re: Importing an exported WorkSheet (2000 - 2007)

    The .cls file is the result of exporting the worksheet code module from the Visual Basic Editor, not the sheet itself. You can use code like this to copy a sheet including contents and code:

    Dim wsh As Worksheet
    Dim wbk As Workbook
    ' Reference to a specific sheet
    Set wsh = Worksheets("...")
    ' Copying a sheet without specifying Before or After ...
    ' ... results in a new workbook
    Set wbk = ActiveWorkbook
    ' Save the new workbook
    wbk.SaveAs "..."

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts