Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Copy an excel sheet from a workbook

Posted on 2014-04-23
6
Medium Priority
?
29 Views
Last Modified: 2016-05-18
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("Newtest")   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).Name = "testresult_01"
    wb_Source_02.SaveAs FileName
   

    Set ws_Source_05 = wb_Source_02.Sheets("testresult_01")    
    )
    ws_Source_04.Cells.Copy Destination:=ws_Source_05.Cells(1, 1)    

Would you advice where to change to get expecting result.

Thanks
0
Comment
Question by:alam747
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
6 Comments
 
LVL 35

Accepted Solution

by:
Norie earned 2000 total points
ID: 40018911
Have you tried this?
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"

Open in new window

It shoud copy ws_Source_04 to a new workbook, with all the data and formatting should be intact, and rename the copied worksheet with the name 'testresult_01'.
0
 

Author Comment

by:alam747
ID: 40019176
The workbook ( wb_Source_02 ) has need to have two sheets
wb_Source_02.Sheets(1).Name = "testresult_01"
wb_Source_02.Sheets(2).Name = "testresult_02"

only want to copy ws_Source_04 to "testresult_01"

also want to define cell width of sheet "testresult_02"

Please advice.... Thanks
0
 
LVL 35

Expert Comment

by:Norie
ID: 40020512
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"

Open in new window

0
 

Author Comment

by:alam747
ID: 40024110
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.
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article helps those who get the 0xc004d307 error when trying to rearm (reset the license) Office 2013 in a Virtual Desktop Infrastructure (VDI) and/or those trying to prep the master image for Microsoft Key Management (KMS) activation. (i.e.- C…
Outlook for dependable use in a very small business   This article is about using the Outlook application (part of Microsoft Office) in a very small business, or for homeowners where dependability and reliability are critical requirements. This …
This video shows where to find templates, what they are used for, and how to create and save a custom template using Microsoft Word.
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question