View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Die_Another_Day Die_Another_Day is offline
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!