ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Pasting (https://www.excelbanter.com/excel-programming/361621-pasting.html)

Raman325[_36_]

Pasting
 

Hi,

I'm having a problem copying a range from one sheet and copying it t
the next. To give you an idea of what I'm doing, I have filtered ou
results from a spreadsheet and am trying to copy these results to th
next sheet using the following code:


Code
-------------------
Worksheets(1).Range("A1:S" & Worksheets(1).UsedRange.SpecialCells(xlCellTypeLas tCell).Row).AutoFilter _
Field:=1, Criteria1:=groups(i1), VisibleDropDown:=False
Worksheets(1).Range("A2:S" & Worksheets(1).UsedRange.SpecialCells(xlCellTypeLas tCell).Row).Copy
Worksheets(2).Activate
Worksheets(2).Cells(currRow, "A").Past
-------------------

(This is part of a bigger macro)

When I run the macro, however, I get that the Object doesn't suppor
the method. Am I using the wrong method?

Thanks in advanc

--
Raman32
-----------------------------------------------------------------------
Raman325's Profile: http://www.excelforum.com/member.php...fo&userid=2474
View this thread: http://www.excelforum.com/showthread.php?threadid=54256


Tom Ogilvy

Pasting
 
Perhaps this way:

Worksheets(1).Range("A1").CurrentRegion.Resize(,19 ).AutoFilter _
Field:=1, Criteria1:=groups(i1), VisibleDropDown:=False
Worksheets(1).AutoFilter.Range.Copy
Worksheets(2).Activate
Worksheets(2).Cells(currRow, "A").Paste

--
Regards,
Tom Ogilvy


"Raman325" wrote:


Hi,

I'm having a problem copying a range from one sheet and copying it to
the next. To give you an idea of what I'm doing, I have filtered out
results from a spreadsheet and am trying to copy these results to the
next sheet using the following code:


Code:
--------------------
Worksheets(1).Range("A1:S" & Worksheets(1).UsedRange.SpecialCells(xlCellTypeLas tCell).Row).AutoFilter _
Field:=1, Criteria1:=groups(i1), VisibleDropDown:=False
Worksheets(1).Range("A2:S" & Worksheets(1).UsedRange.SpecialCells(xlCellTypeLas tCell).Row).Copy
Worksheets(2).Activate
Worksheets(2).Cells(currRow, "A").Paste
--------------------

(This is part of a bigger macro)

When I run the macro, however, I get that the Object doesn't support
the method. Am I using the wrong method?

Thanks in advance


--
Raman325
------------------------------------------------------------------------
Raman325's Profile: http://www.excelforum.com/member.php...o&userid=24748
View this thread: http://www.excelforum.com/showthread...hreadid=542563




All times are GMT +1. The time now is 04:27 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com