Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You were right about the password but now I have another problem. I did not
build this original project but ask to add a piece to this project. The page that I am copying from has merged cells. Is there any way to get around the problem? I have tried copying the template with the merge cells to the TempTable sheet but it didnt work. The following error occurs €śThis operation requires the merged cells to be identically sized.€ť Is there any way around it? Thanks for all you help and replying back so promptly. -- ca1358 "Jim Thomlinson" wrote: That code works for me. My best guess is that your worksheet TempTable is protected. If so then try this 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 "your password" rngToPaste.PasteSpecial xlPasteValues wksToPaste.Protect "your password" Application.CutCopyMode = False End Sub -- HTH... Jim Thomlinson "ca1358" wrote: -- I rec'd run-time error "1004" PasteSpecial method of Range class failed. Any suggestions. Thank you for the first part, beening trying for day just to get that part to work. ca1358 "Jim Thomlinson" wrote: Private Sub cmdGN15Data1_Click() Dim rngToCopy As Range Dim rngToPaste As Range Set rngToCopy = Sheets("GN15").Range("A28:v28") Set rngToPaste = Sheets("TempTable").Cells(Rows.Count, _ "A").End(xlUp).Offset(1, 0) rngToCopy.Copy rngToPaste.PasteSpecial xlPasteValues End Sub -- HTH... Jim Thomlinson "ca1358" wrote: This works. One more question? How do you paste special values? -- ca1358 "Jim Thomlinson" wrote: Give this a try... Private Sub cmdGN15Data1_Click() dim rngToCopy as range dim rngToPaste as range set rngToCopy = sheets("GN15").Range("A28:v28") set rngToPaste = sheets("TempTable").cells(rows.count, "A").end(xlUp).offset(1,0) rngToCopy.copy rngtopaste End Sub -- HTH... Jim Thomlinson "ca1358" wrote: I have 2 worksheets One is Named €śGN15€ť Two is Named €śTempTable€ť On Sheet €śGN15€ť - I need to simply click a command button in cell W28 and copy A28:V28 and then Go To Sheet €śTempTable€ť and paste to the first blank row available. I tried several scenarios and nothing work and I am running out time on this project. Any help would greatly be appreciated. Private Sub cmdGN15Data1_Click() Range("A28:v28").Copy Worksheets("TempTable").Activate End Sub -- ca1358 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() yes there is a way to get around merged cells, never use them on a sheet in which you intend to use VBA code. Not trying to be wiseguy but merged cells create too many difficulties. I only use them in header rows -- Flamikey ------------------------------------------------------------------------ Flamikey's Profile: http://www.excelforum.com/member.php...fo&userid=4612 View this thread: http://www.excelforum.com/showthread...hreadid=489222 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro - Copy/Paste Special to Next Blank Line | New Users to Excel | |||
Use Macro to Copy and paste formulas from one spreadsheet to anoth | Excel Discussion (Misc queries) | |||
VBA Code- Copy & Paste in Blank Range | Excel Discussion (Misc queries) | |||
In Excel, how do you copy and paste just the subtotals into anoth. | Excel Discussion (Misc queries) | |||
Advanced Filter Copy Paste Blank Line Hell :( | Excel Programming |