Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 72
Default Copy data to next available row

I have looked at posts on this subject, but can't seem to get it to work for
me.

At the OK command event, I want to copy cells in the Range B14:N33 in Sheet1
to the next available row in Column A of the "Data" worksheet all within the
same workbook.

How do I get this to work?

Thanks to the Excel experts for your generous help!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 644
Default Copy data to next available row

Sub CopyRange()
Sheets("Sheet1").Range("B14:N33").Copy
Sheets("Data").Range("A1").End(xlDown).Offset(1,0) .PasteSpecial
xlPasteAll
End Sub

HTH

Die_Another_Day

TimN wrote:
I have looked at posts on this subject, but can't seem to get it to work for
me.

At the OK command event, I want to copy cells in the Range B14:N33 in Sheet1
to the next available row in Column A of the "Data" worksheet all within the
same workbook.

How do I get this to work?

Thanks to the Excel experts for your generous help!


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 72
Default Copy data to next available row

Didn't quite work. Nothing copied over to the Data worksheet. The Data
worksheet has cells A4:M23 highlighted. The next available cell as it
currently sits would be cell A61. Any thoughts?

"Die_Another_Day" wrote:

Sub CopyRange()
Sheets("Sheet1").Range("B14:N33").Copy
Sheets("Data").Range("A1").End(xlDown).Offset(1,0) .PasteSpecial
xlPasteAll
End Sub

HTH

Die_Another_Day

TimN wrote:
I have looked at posts on this subject, but can't seem to get it to work for
me.

At the OK command event, I want to copy cells in the Range B14:N33 in Sheet1
to the next available row in Column A of the "Data" worksheet all within the
same workbook.

How do I get this to work?

Thanks to the Excel experts for your generous help!



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 72
Default Copy data to next available row

I have the following working with one exception:

Dim rCell As Range
With Application.ThisWorkbook
Set rCell = .Worksheets("Data").Range("A65536").End(xlUp).Offs et(1, 0)
Worksheets("Sheet1").Range("B14:N33").Copy
rCell.PasteSpecial Paste:=xlValues
'CutCopyMode = False
End With
Unload Me
End Sub

I have the CutCopyMode = False line commented out. Otherwise I get a
Compile Error, Variable not Defined error message. However, this code works
with the exception of the area I copy is still surrounded with the moving
border (still selected to be copied). What am I doing wrong here?



"Die_Another_Day" wrote:

Sub CopyRange()
Sheets("Sheet1").Range("B14:N33").Copy
Sheets("Data").Range("A1").End(xlDown).Offset(1,0) .PasteSpecial
xlPasteAll
End Sub

HTH

Die_Another_Day

TimN wrote:
I have looked at posts on this subject, but can't seem to get it to work for
me.

At the OK command event, I want to copy cells in the Range B14:N33 in Sheet1
to the next available row in Column A of the "Data" worksheet all within the
same workbook.

How do I get this to work?

Thanks to the Excel experts for your generous help!



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Copy data to next available row

See
http://www.rondebruin.nl/copy1.htm

--
Regards Ron de Bruin
http://www.rondebruin.nl



"TimN" wrote in message ...
I have looked at posts on this subject, but can't seem to get it to work for
me.

At the OK command event, I want to copy cells in the Range B14:N33 in Sheet1
to the next available row in Column A of the "Data" worksheet all within the
same workbook.

How do I get this to work?

Thanks to the Excel experts for your generous help!





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 644
Default Copy data to next available row

Move the CutCopyMode out of the with statement and put "Application" in
front of it
Application.CutCopyMode = False

Die_Another_Day
TimN wrote:
I have the following working with one exception:

Dim rCell As Range
With Application.ThisWorkbook
Set rCell = .Worksheets("Data").Range("A65536").End(xlUp).Offs et(1, 0)
Worksheets("Sheet1").Range("B14:N33").Copy
rCell.PasteSpecial Paste:=xlValues
'CutCopyMode = False
End With
Unload Me
End Sub

I have the CutCopyMode = False line commented out. Otherwise I get a
Compile Error, Variable not Defined error message. However, this code works
with the exception of the area I copy is still surrounded with the moving
border (still selected to be copied). What am I doing wrong here?



"Die_Another_Day" wrote:

Sub CopyRange()
Sheets("Sheet1").Range("B14:N33").Copy
Sheets("Data").Range("A1").End(xlDown).Offset(1,0) .PasteSpecial
xlPasteAll
End Sub

HTH

Die_Another_Day

TimN wrote:
I have looked at posts on this subject, but can't seem to get it to work for
me.

At the OK command event, I want to copy cells in the Range B14:N33 in Sheet1
to the next available row in Column A of the "Data" worksheet all within the
same workbook.

How do I get this to work?

Thanks to the Excel experts for your generous help!




  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Copy data to next available row


Paste this in to the ok event, it worked for me in a seperate module so
in the OK event you could call it from a seperate module i.e Call
Test

Hope this helps,
Simon

Sub Test()
Dim rng1 As Range
Dim rng As Range
Set rng = Range("B14:N33")
rng.Copy
Sheets("Data").Select
Set rng1 = Worksheets("Data").Cells(Rows.Count, 1).End(xlUp)(2)
rng1.Select
ActiveSheet.Paste
CutCopyMode = False
Worksheets("Sheet1").Select
End Sub


--
Simon Lloyd
------------------------------------------------------------------------
Simon Lloyd's Profile: http://www.excelforum.com/member.php...fo&userid=6708
View this thread: http://www.excelforum.com/showthread...hreadid=566679

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
How copy none excel data & paste in 2007 without overwriting data Wakefootin Excel Discussion (Misc queries) 2 October 8th 09 12:15 AM
Retrieve multiple data rows data from a very long list and copy t mathew Excel Discussion (Misc queries) 1 September 13th 06 08:24 PM
How do I copy data from main frame computer and keep data in cell Doug Excel Worksheet Functions 1 May 30th 06 05:15 PM
Copy old Data from web query while keeping previous days data DRobidoux Excel Worksheet Functions 0 March 22nd 06 01:56 PM
Copy data into cells until changes trigger new copy mdeanda Excel Programming 2 April 25th 05 01:32 PM


All times are GMT +1. The time now is 11:55 PM.

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"