Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 37
Default Copy a Range from sheet and paste the next blank line in anoth

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Copy a Range from sheet and paste the next blank line in another s


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
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
Macro - Copy/Paste Special to Next Blank Line lajohn63 New Users to Excel 2 August 27th 12 09:27 PM
Use Macro to Copy and paste formulas from one spreadsheet to anoth bevchapman Excel Discussion (Misc queries) 3 October 6th 09 05:50 PM
VBA Code- Copy & Paste in Blank Range Youlan Excel Discussion (Misc queries) 9 March 27th 08 03:22 PM
In Excel, how do you copy and paste just the subtotals into anoth. mmiazga Excel Discussion (Misc queries) 4 February 13th 05 01:17 AM
Advanced Filter Copy Paste Blank Line Hell :( Mike[_81_] Excel Programming 5 April 30th 04 11:41 PM


All times are GMT +1. The time now is 03:50 PM.

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

About Us

"It's about Microsoft Excel"