Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have (A) spreadsheet that has a template with 3 merged cells,
So I made a 2nd (B) spreadsheet with same template. Set up code to copy a line from (A) and paste to (B) but I get an error This operation requires the merged cells to be identically sized. . Both sheets are identical. Can someone tell me how to get around this? -- ca1358 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Can you please submit the code you are using?
Alok "ca1358" wrote: I have (A) spreadsheet that has a template with 3 merged cells, So I made a 2nd (B) spreadsheet with same template. Set up code to copy a line from (A) and paste to (B) but I get an error This operation requires the merged cells to be identically sized. . Both sheets are identical. Can someone tell me how to get around this? -- ca1358 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
It stops at this line in the sub and gives me the error.
rngToPaste.PasteSpecial xlPasteValues Private Sub cmdGN15Data1_Click() Dim rngToCopy As Range Dim rngToPaste As Range Dim wksToPaste As Worksheet Set rngToCopy = Sheets("GN15").Range("A28:v28") Set wksToPaste = Sheets("TempTable") Set rngToPaste = wksToPaste.Cells(Rows.Count, _ "A").End(xlUp).Offset(1, 0) rngToCopy.Copy wksToPaste.Unprotect "Cubs1908" rngToPaste.PasteSpecial xlPasteValues wksToPaste.Protect "Cubs1908" Application.CutCopyMode = False -- ca1358 "Alok" wrote: Can you please submit the code you are using? Alok "ca1358" wrote: I have (A) spreadsheet that has a template with 3 merged cells, So I made a 2nd (B) spreadsheet with same template. Set up code to copy a line from (A) and paste to (B) but I get an error This operation requires the merged cells to be identically sized. . Both sheets are identical. Can someone tell me how to get around this? -- ca1358 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try changing it to:
' rngToCopy.Copy wksToPaste.Unprotect "Cubs1908" rngToPaste.Resize(rngTocopy.Rows.count, _ rngToCopy.columns.count).Value = rngTocopy wksToPaste.Protect "Cubs1908" -- Regards, Tom Ogilvy "ca1358" wrote in message ... It stops at this line in the sub and gives me the error. rngToPaste.PasteSpecial xlPasteValues Private Sub cmdGN15Data1_Click() Dim rngToCopy As Range Dim rngToPaste As Range Dim wksToPaste As Worksheet Set rngToCopy = Sheets("GN15").Range("A28:v28") Set wksToPaste = Sheets("TempTable") Set rngToPaste = wksToPaste.Cells(Rows.Count, _ "A").End(xlUp).Offset(1, 0) rngToCopy.Copy wksToPaste.Unprotect "Cubs1908" rngToPaste.PasteSpecial xlPasteValues wksToPaste.Protect "Cubs1908" Application.CutCopyMode = False -- ca1358 "Alok" wrote: Can you please submit the code you are using? Alok "ca1358" wrote: I have (A) spreadsheet that has a template with 3 merged cells, So I made a 2nd (B) spreadsheet with same template. Set up code to copy a line from (A) and paste to (B) but I get an error "This operation requires the merged cells to be identically sized." . Both sheets are identical. Can someone tell me how to get around this? -- ca1358 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
sorting problems - error message: identically sized merged cells. | Excel Discussion (Misc queries) | |||
Operation requires the merged cells to be identically sized | Excel Worksheet Functions | |||
Odd error - "This operation requires merged cells..." | New Users to Excel | |||
Error This operation requires the merged cells to be identically | Excel Programming | |||
requires that merged cells must be identically sized? | Excel Discussion (Misc queries) |