Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy and Paste - Last Row
I am a new to most of this but have done ok with google so far. I have a problem doing a copy and paste , trying to paste into the first blank row of a workbook. Here is what I am trying to use right now
..Columns("A:F").AutoFilter Field:=6, Criteria1:="Brand ..Columns("A:F").SpecialCells(xlCellTypeVisible).C opy Destination:= Windows("AllBrands").ActivateSheets("Sheet1").Rang e("A" & Rows.Count).End(xlUp).Offset(1 I get this error message - and I am not sure what it mean "Object Doesn't Support This Property Or Method It is pasting from one workbook to another - in case that is importan I would appreciate any advise I can get on this - I am really not sure what is wrong |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy and Paste - Last Row
Adam,
A few things that I can see: Your object error is because the Windows collection does not have a property called ActivateSheets. Instead of ActivateSheets("Sheet1").Range, try ActiveSheet.Range You're copying a few columns of data, but pasting it into a subsection of itself? I suspect what you're really trying to do is copy all the visible rows, not columns? Am I correct? This code will probably do what you're after, assuming row 1 is your header row. Sub testit() Dim lngLastRow As Long With Sheet1 lngLastRow = .Cells(Rows.Count, 1).End(xlUp).Row .Columns("A:F").AutoFilter Field:=6, Criteria1:="Brand" .Range(.Rows(2), ..Rows(lngLastRow)).SpecialCells(xlCellTypeVisible ).Copy Destination:= _ .Rows(lngLastRow + 1) End With End Sub Rob "Adam Jones" wrote in message ... I am a new to most of this but have done ok with google so far. I have a problem doing a copy and paste , trying to paste into the first blank row of a workbook. Here is what I am trying to use right now. .Columns("A:F").AutoFilter Field:=6, Criteria1:="Brand" .Columns("A:F").SpecialCells(xlCellTypeVisible).Co py Destination:= _ Windows("AllBrands").ActivateSheets("Sheet1").Rang e("A" & Rows.Count).End(xlUp).Offset(1) I get this error message - and I am not sure what it means "Object Doesn't Support This Property Or Method" It is pasting from one workbook to another - in case that is important I would appreciate any advise I can get on this - I am really not sure what is wrong |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy and Paste - Last Row
Ok, I think I follow what you are saying about coping rows instead of columns. I tried the code you provided me, but first I inserted a window("AllBrands") after the destination part - because after the data that is visiable is copied, it has to then be pasted into a different workbook
With Sheet lngLastRow = .Cells(Rows.Count, 1).End(xlUp).Ro .Columns("A:F").AutoFilter Field:=6, Criteria1:="Brand .Range(.Rows(2), Rows(lngLastRow)).SpecialCells(xlCellTypeVisible). Copy Destination:= Windors("AllBrands.xls").Rows(lngLastRow + 1 End Wit But now I still get errors. Arrgh...., I wish I understood this bette Any further advise would be great, I am not sure where I went wrong |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy and Paste - Last Row
Please outline your requirements. It's difficult to determine your needs by
reading your code. "Adam Jones" wrote in message ... Ok, I think I follow what you are saying about coping rows instead of columns. I tried the code you provided me, but first I inserted a window("AllBrands") after the destination part - because after the data that is visiable is copied, it has to then be pasted into a different workbook. With Sheet1 lngLastRow = .Cells(Rows.Count, 1).End(xlUp).Row .Columns("A:F").AutoFilter Field:=6, Criteria1:="Brand" .Range(.Rows(2), Rows(lngLastRow)).SpecialCells(xlCellTypeVisible). Copy Destination:= _ Windors("AllBrands.xls").Rows(lngLastRow + 1) End With But now I still get errors. Arrgh...., I wish I understood this better Any further advise would be great, I am not sure where I went wrong |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
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) | |||
I cannot paste from one workbook to another. Copy works, paste do. | Excel Discussion (Misc queries) |