alam747
asked on
Copy an excel sheet from a workbook
I did as below to copy a sheet from an excel workbook include all data include a windings a face character. while it creat workbook and copy the sheet winding face is disapear also source excel sheet background is white no grid but while copied the sheet with grid line which is normal background of an execel sheet while open.
Set ws_Source_04 = wb_Source_01.Sheets("Newte st") this is the source sheet which is in white backgroud with winding face character
Set wb_Source_02 = Workbooks.Add
wb_Source_02.Sheets(1).Nam e = "testresult_01"
wb_Source_02.SaveAs FileName
Set ws_Source_05 = wb_Source_02.Sheets("testr esult_01")
)
ws_Source_04.Cells.Copy Destination:=ws_Source_05. Cells(1, 1)
Would you advice where to change to get expecting result.
Thanks
Set ws_Source_04 = wb_Source_01.Sheets("Newte
Set wb_Source_02 = Workbooks.Add
wb_Source_02.Sheets(1).Nam
wb_Source_02.SaveAs FileName
Set ws_Source_05 = wb_Source_02.Sheets("testr
)
ws_Source_04.Cells.Copy Destination:=ws_Source_05.
Would you advice where to change to get expecting result.
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
This will copy both worksheets to a new worksheet.
Set ws_Source_04 = wb_Source_01.Sheets("Newtest")
ws_Source_04.Copy
Set wb_Source_02 = ActiveWorkbook
wb_Source_02.Sheets(1).Name = "testresult_01"
ws_Source_05.Copy After:=wb_Source_02.Sheets(1)
wb_Source_02.Sheets(2).Name = "testresult_02"
ASKER
want to use first raw of the 2nd sheet as header in bold character and set the width as autofit of cell (A:A) to cell(M:M)
and color the header in light blue ( only the first raw of the cell A ~ M ).
Please advise.
and color the header in light blue ( only the first raw of the cell A ~ M ).
Please advise.
ASKER
wb_Source_02.Sheets(1).Nam
wb_Source_02.Sheets(2).Nam
only want to copy ws_Source_04 to "testresult_01"
also want to define cell width of sheet "testresult_02"
Please advice.... Thanks