Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Copy paste non merged to merged cells | Excel Worksheet Functions | |||
Copy/Paste into merged cells | Excel Discussion (Misc queries) | |||
Copy/Paste formulas in merged cells | Excel Discussion (Misc queries) | |||
Copy/Cut/Paste of Merged Cells in Shared Protected Workbooks | Excel Discussion (Misc queries) | |||
copy and paste from different sheets into one sheet using a VB code | Excel Programming |