Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default 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
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
I cannot paste from one workbook to another. Copy works, paste do. JimmyMc Excel Discussion (Misc queries) 1 June 10th 05 03:54 PM


All times are GMT +1. The time now is 08:30 AM.

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"