Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Copy and paste of sheets via VBA code that has merged cells

Hi...

I am attempting some copy and pasting of cells in a large worksheet.

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 idenitcle 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 highlited.

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

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

Can anyone help ?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Copy and paste of sheets via VBA code that has merged cells

John
it looks like you have a simular problem to one that i am working on. you
might look at what the experts are telling me.
simple cell copy using VBA this was started on 12/17/04 hopefully
someone can tell the both of us how to do this.



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

I am attempting some copy and pasting of cells in a large worksheet.

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 idenitcle 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 highlited.

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

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

Can anyone help ?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 201
Default Copy and paste of sheets via VBA code that has merged cells

John, Bob
You have both been victimized by the "Merged" cells gotcha. The fact is
that merging of cells causes more problems than it is worth. Simply put,
Excel does not do merging of cells well at all. You would be better off if
you never, ever, use that feature. There are other ways of achieving the
same result without merging the cells. See Format - Cells - Alignment tab -
Horizontal - 'Center across selection". HTH Otto
"John Corbin" wrote in message
...
Hi...

I am attempting some copy and pasting of cells in a large worksheet.

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 idenitcle 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 highlited.

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

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

Can anyone help ?



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,092
Default Copy and paste of sheets via VBA code that has merged cells

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.

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 idenitcle 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 highlited.

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

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

Can anyone help ?



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy paste non merged to merged cells [email protected] Excel Worksheet Functions 1 February 5th 09 05:25 PM
Copy/Paste into merged cells NicoleS Excel Discussion (Misc queries) 2 December 29th 08 11:48 PM
Copy/Paste formulas in merged cells Excel User 123456 Excel Discussion (Misc queries) 2 December 18th 08 07:58 PM
Copy/Cut/Paste of Merged Cells in Shared Protected Workbooks DaveyC4S Excel Discussion (Misc queries) 0 September 20th 05 01:24 PM
copy and paste from different sheets into one sheet using a VB code reena Excel Programming 2 August 5th 03 02:49 PM


All times are GMT +1. The time now is 01:11 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"