#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 55
Default Copy/Paste

The following code has worked good for me in the past:

Dim rng As Range
Set rng = ActiveSheet.AutoFilter.Range
rng.Copy Destination:=Worksheets("Old Data").Range("A1")
Sheets("Old Data").Range("A1").EntireRow.Delete Shift:=xlUp

However, I now want it to "Insert the Copied Data" at the destination and
shift the existing data down.

The code currently allows the data to be pasted over any existing data???
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default Copy/Paste

That'll put the data (plus the headers) at the bottom of the range. If I
read correctly, the OP wanted a way to shift existing data down instead.

In article ,
"Don Guillett" wrote:

with worksheets("Old Data")
Set rng = ActiveSheet.AutoFilter.Range
rng.Copy .Range("A" & .cells(rows.count,"a").end(xlup).row+1)
end with

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default Copy/Paste

One way:

Dim rng As Range
Dim nRows As Long
Set rng = ActiveSheet.AutoFilter.Range
nRows = rng.Columns(1).SpecialCells(xlCellTypeVisible).Cou nt
With Worksheets("Old Data")
.Range("A1").Resize(nRows).EntireRow.Insert Shift:=xlDown
rng.Copy Destination:=.Range("A1")
.Range("A1").EntireRow.Delete
End With

In article ,
"scrabtree23" wrote:

The following code has worked good for me in the past:

Dim rng As Range
Set rng = ActiveSheet.AutoFilter.Range
rng.Copy Destination:=Worksheets("Old Data").Range("A1")
Sheets("Old Data").Range("A1").EntireRow.Delete Shift:=xlUp

However, I now want it to "Insert the Copied Data" at the destination and
shift the existing data down.

The code currently allows the data to be pasted over any existing data???

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
Can't Copy and Paste or Paste Special between Excel Workbooks wllee Excel Discussion (Misc queries) 5 April 29th 23 03:43 AM
Copy, paste without file name referenced after paste AusTexRich Excel Discussion (Misc queries) 6 September 23rd 08 02:57 AM
Copy; Paste; Paste Special are disabled Mack Neff[_3_] Excel Discussion (Misc queries) 0 April 28th 08 06:29 PM
Excel cut/Paste Problem: Year changes after data is copy and paste Asif Excel Discussion (Misc queries) 2 December 9th 05 05:16 PM
Macro to Copy/Paste then Paste to Next Line tomkarakowski Excel Programming 1 May 28th 04 01:19 AM


All times are GMT +1. The time now is 03:42 AM.

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"