how to make merged cells on a new sheet

G

Guest

Hi all,

I have to copy a portion of a sheet into another workbook's sheet, some
cells in the portion are merged and I would like to remain the same layout
on the new sheet.
this is my code:

Range("A1:A5").Copy
Destination:=Workbooks("book1").Sheets("sheet1").Range("A1")

it only copy value and cell format, but can not merge cells on the new sheet

thank you for your help in advance

Clara
 
G

Guest

If you included the entire area or all of the current region, then the merged
cell should copy over. Say cells A5, A6, and A7 are merged, then you would
use this to copy the merged cell:
Range("A5").CurrentRegion.Copy
Destination:=Workbooks("Book1").Sheets("Sheet1").Range("A1")
Hope this helps.
 
G

Guest

Hi Anony,

My sheet is not organized in different region, it is more like a form
providind many
cells for user input data. Anyway, thank you for your help

Clara
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top