none
Macros Not Copying the Format properly RRS feed

  • Question

  • Hello,

    I am trying to merge multiple workbooks into one master workbook. However, when I am trying to use Macro OR Move or Copy functionality in excel, the formatting is not properlt copied.. Could someone please take a look.

    I am attaching the sample excel sheet and below is the macro I am using:

    Sub GetSheets()
    Path = "C:\Users\ssehgal\Documents\Excel-Files-For-Macro\"
    Filename = Dir(Path & "*.xls")
      Do While Filename <> ""
      Workbooks.Open Filename:=Path & Filename, ReadOnly:=True
         For Each Sheet In ActiveWorkbook.Sheets
         Sheet.Copy After:=ThisWorkbook.Sheets(1)
      Next Sheet
         Workbooks(Filename).Close
         Filename = Dir()
      Loop
    End Sub

    Tuesday, June 30, 2015 11:12 PM

All replies

  • Hi,

    Base on my test in excel 2007 and excel 2013, both of them works fine.

    Which formatting that it isn’t copied? Please provide the screenshot or more information of the formatting.

    Regards

    Starain


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, July 2, 2015 6:12 AM
    Moderator