ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   how to make merged cells on a new sheet (https://www.excelbanter.com/excel-programming/395071-how-make-merged-cells-new-sheet.html)

clara

how to make merged cells on a new sheet
 
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").R ange("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
--
thank you so much for your help

Anony

how to make merged cells on a new sheet
 
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").R ange("A1")
Hope this helps.

------
Cheers,
Anony


"clara" wrote:

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").R ange("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
--
thank you so much for your help


clara

how to make merged cells on a new sheet
 
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


"Anony" wrote:

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").R ange("A1")
Hope this helps.

------
Cheers,
Anony


"clara" wrote:

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").R ange("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
--
thank you so much for your help



All times are GMT +1. The time now is 06:58 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com