ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Copy and pasting sheets with merged cells (https://www.excelbanter.com/excel-programming/319261-copy-pasting-sheets-merged-cells.html)

John Corbin[_2_]

Copy and pasting sheets with merged cells
 
Hi...

I am attempting some copy and pasting of cells in a large worksheet (
not sure if attachments are allowed here )

Basically on the settings' page I set the year using the slider feature and
the calender is created in the calender sheet and then copied to the
various months of the year.

The row height and column width have been checked and are identicle
across all the pages.

When I run the code I get an error ( RUN TIME ERROR 1004 ) which
basically says that this operation requires the cells be identically
sized. This line of the VB code is highlighted.

Worksheets(strPageName).Range("A5").PasteSpecial Paste:=xlPasteValues

I have checked all the cells and cannot see the problem.

Can anyone help ?

Mike Fogleman

Copy and pasting sheets with merged cells
 
See my reply from your earlier post:

I have found that you can paste to the formulabar of a cell or merged cells.
If cells A1:C1 are merged and you want to paste the value from F1 to the
merged cells, this code works:

Range("A1").Formula = Range("F1").Value

This may be of some use to your needs,
Mike F

"John Corbin" wrote in message
...
Hi...

I am attempting some copy and pasting of cells in a large worksheet (
not sure if attachments are allowed here )

Basically on the settings' page I set the year using the slider feature

and
the calender is created in the calender sheet and then copied to the
various months of the year.

The row height and column width have been checked and are identicle
across all the pages.

When I run the code I get an error ( RUN TIME ERROR 1004 ) which
basically says that this operation requires the cells be identically
sized. This line of the VB code is highlighted.

Worksheets(strPageName).Range("A5").PasteSpecial Paste:=xlPasteValues

I have checked all the cells and cannot see the problem.

Can anyone help ?




Tom Ogilvy

Copy and pasting sheets with merged cells
 
You have three answers to your first posting of this question.

--
Regards,
Tom Ogilvy

"John Corbin" wrote in message
...
Hi...

I am attempting some copy and pasting of cells in a large worksheet (
not sure if attachments are allowed here )

Basically on the settings' page I set the year using the slider feature

and
the calender is created in the calender sheet and then copied to the
various months of the year.

The row height and column width have been checked and are identicle
across all the pages.

When I run the code I get an error ( RUN TIME ERROR 1004 ) which
basically says that this operation requires the cells be identically
sized. This line of the VB code is highlighted.

Worksheets(strPageName).Range("A5").PasteSpecial Paste:=xlPasteValues

I have checked all the cells and cannot see the problem.

Can anyone help ?





All times are GMT +1. The time now is 09:34 AM.

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