Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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??? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
try
with worksheets("Old Data") Set rng = ActiveSheet.AutoFilter.Range rng.Copy .Range("A" & .cells(rows.count,"a").end(xlup).row+1) end with -- Don Guillett SalesAid Software "scrabtree23" wrote in message ... 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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Can't Copy and Paste or Paste Special between Excel Workbooks | Excel Discussion (Misc queries) | |||
Copy, paste without file name referenced after paste | Excel Discussion (Misc queries) | |||
Copy; Paste; Paste Special are disabled | Excel Discussion (Misc queries) | |||
Excel cut/Paste Problem: Year changes after data is copy and paste | Excel Discussion (Misc queries) | |||
Macro to Copy/Paste then Paste to Next Line | Excel Programming |