Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Select Method of Range Class Failed

I have been working with the MACRO below but I keep getting the error:
Select Method of Range Class Failed. when I run it.

What I have is data on one worksheet if that data equals a criteria it
is to go over to the EXITS worksheet. I had that working but the data
would just overwrite what was there before. I got some help with
having EXCEL look for the next blank line before writing new data but
now I get that error.

Any help?



Sub Macro1()
'
' Macro1 Macro
' Macro recorded 6/21/2007 by System Administrator
'

'
Range("A7:U220").Select
Selection.AutoFilter
Selection.AutoFilter Field:=14, Criteria1:="y"
Range("A31:O42").Select
Selection.Copy
Dim rng As Range
With Cells
Sheets("Exits").Select
Set rng = .Range(.Cells(1, 1), .Cells(1, 1)).End(xlDown)
rng.Offset(1, 0).Select
Selection.PasteSpecial
End With



Sheets("Exits").Select
Range("A11").Select
ActiveSheet.Paste
Range("A13").Select
Sheets("Participant Worksheet").Select
Application.CutCopyMode = False
Selection.ClearContents
Selection.AutoFilter
Range("C2").Select
End Sub

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Select Method of Range Class Failed

Range("A7:U220").AutoFilter Field:=14, Criteria1:="y"
Range("A31:O42").Copy _
Sheets("Exits").Cells(Rows.Count, 1).End(xlUp)(2)

Should do what you want...

HTH,
Bernie
MS Excel MVP


wrote in message ups.com...
I have been working with the MACRO below but I keep getting the error:
Select Method of Range Class Failed. when I run it.

What I have is data on one worksheet if that data equals a criteria it
is to go over to the EXITS worksheet. I had that working but the data
would just overwrite what was there before. I got some help with
having EXCEL look for the next blank line before writing new data but
now I get that error.

Any help?



Sub Macro1()
'
' Macro1 Macro
' Macro recorded 6/21/2007 by System Administrator
'

'
Range("A7:U220").Select
Selection.AutoFilter
Selection.AutoFilter Field:=14, Criteria1:="y"
Range("A31:O42").Select
Selection.Copy
Dim rng As Range
With Cells
Sheets("Exits").Select
Set rng = .Range(.Cells(1, 1), .Cells(1, 1)).End(xlDown)
rng.Offset(1, 0).Select
Selection.PasteSpecial
End With



Sheets("Exits").Select
Range("A11").Select
ActiveSheet.Paste
Range("A13").Select
Sheets("Participant Worksheet").Select
Application.CutCopyMode = False
Selection.ClearContents
Selection.AutoFilter
Range("C2").Select
End Sub



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Select Method of Range Class Failed

Thanks but I am not certain where to put it in the MACRO.



On Jun 21, 9:54 am, "Bernie Deitrick" <deitbe @ consumer dot org
wrote:
Range("A7:U220").AutoFilter Field:=14, Criteria1:="y"
Range("A31:O42").Copy _
Sheets("Exits").Cells(Rows.Count, 1).End(xlUp)(2)

Should do what you want...

HTH,
Bernie
MS Excel MVP



wrote in oglegroups.com...
I have been working with the MACRO below but I keep getting the error:
Select Method of Range Class Failed. when I run it.


What I have is data on one worksheet if that data equals a criteria it
is to go over to the EXITS worksheet. I had that working but the data
would just overwrite what was there before. I got some help with
having EXCEL look for the next blank line before writing new data but
now I get that error.


Any help?


Sub Macro1()
'
' Macro1 Macro
' Macro recorded 6/21/2007 by System Administrator
'


'
Range("A7:U220").Select
Selection.AutoFilter
Selection.AutoFilter Field:=14, Criteria1:="y"
Range("A31:O42").Select
Selection.Copy
Dim rng As Range
With Cells
Sheets("Exits").Select
Set rng = .Range(.Cells(1, 1), .Cells(1, 1)).End(xlDown)
rng.Offset(1, 0).Select
Selection.PasteSpecial
End With


Sheets("Exits").Select
Range("A11").Select
ActiveSheet.Paste
Range("A13").Select
Sheets("Participant Worksheet").Select
Application.CutCopyMode = False
Selection.ClearContents
Selection.AutoFilter
Range("C2").Select
End Sub- Hide quoted text -


- Show quoted text -



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Select Method of Range Class Failed

It is the whole macro, or at least what comprehensible, useful code you had. At the least, it should
replace:

Range("A7:U220").Select
Selection.AutoFilter
Selection.AutoFilter Field:=14, Criteria1:="y"
Range("A31:O42").Select
Selection.Copy
Dim rng As Range
With Cells
Sheets("Exits").Select
Set rng = .Range(.Cells(1, 1), .Cells(1, 1)).End(xlDown)
rng.Offset(1, 0).Select
Selection.PasteSpecial
End With


Code like this:

Sheets("Participant Worksheet").Select
Application.CutCopyMode = False
Selection.ClearContents


will depend on what the selection on "Participant Worksheet" is, which may lead to unexpected
results.... Much better would be specifying the range to clear:

Sheets("Participant Worksheet").Range("A1:B20").ClearContents


HTH,
Bernie
MS Excel MVP


wrote in message ps.com...
Thanks but I am not certain where to put it in the MACRO.



On Jun 21, 9:54 am, "Bernie Deitrick" <deitbe @ consumer dot org
wrote:
Range("A7:U220").AutoFilter Field:=14, Criteria1:="y"
Range("A31:O42").Copy _
Sheets("Exits").Cells(Rows.Count, 1).End(xlUp)(2)

Should do what you want...

HTH,
Bernie
MS Excel MVP



wrote in oglegroups.com...
I have been working with the MACRO below but I keep getting the error:
Select Method of Range Class Failed. when I run it.


What I have is data on one worksheet if that data equals a criteria it
is to go over to the EXITS worksheet. I had that working but the data
would just overwrite what was there before. I got some help with
having EXCEL look for the next blank line before writing new data but
now I get that error.


Any help?


Sub Macro1()
'
' Macro1 Macro
' Macro recorded 6/21/2007 by System Administrator
'


'
Range("A7:U220").Select
Selection.AutoFilter
Selection.AutoFilter Field:=14, Criteria1:="y"
Range("A31:O42").Select
Selection.Copy
Dim rng As Range
With Cells
Sheets("Exits").Select
Set rng = .Range(.Cells(1, 1), .Cells(1, 1)).End(xlDown)
rng.Offset(1, 0).Select
Selection.PasteSpecial
End With


Sheets("Exits").Select
Range("A11").Select
ActiveSheet.Paste
Range("A13").Select
Sheets("Participant Worksheet").Select
Application.CutCopyMode = False
Selection.ClearContents
Selection.AutoFilter
Range("C2").Select
End Sub- Hide quoted text -


- Show quoted text -





  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Select Method of Range Class Failed

Not tested it, burt Range is not a property of Cells. Maybe try this

With Sheets("Exits")
Set rng = .Range(.Cells(1, 1), .Cells(1, 1)).End(xlDown)
rng.Offset(1, 0).PasteSpecial
End With

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

wrote in message
ups.com...
I have been working with the MACRO below but I keep getting the error:
Select Method of Range Class Failed. when I run it.

What I have is data on one worksheet if that data equals a criteria it
is to go over to the EXITS worksheet. I had that working but the data
would just overwrite what was there before. I got some help with
having EXCEL look for the next blank line before writing new data but
now I get that error.

Any help?



Sub Macro1()
'
' Macro1 Macro
' Macro recorded 6/21/2007 by System Administrator
'

'
Range("A7:U220").Select
Selection.AutoFilter
Selection.AutoFilter Field:=14, Criteria1:="y"
Range("A31:O42").Select
Selection.Copy
Dim rng As Range
With Cells
Sheets("Exits").Select
Set rng = .Range(.Cells(1, 1), .Cells(1, 1)).End(xlDown)
rng.Offset(1, 0).Select
Selection.PasteSpecial
End With



Sheets("Exits").Select
Range("A11").Select
ActiveSheet.Paste
Range("A13").Select
Sheets("Participant Worksheet").Select
Application.CutCopyMode = False
Selection.ClearContents
Selection.AutoFilter
Range("C2").Select
End Sub





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
Select method of Range class failed Capo Excel Programming 4 August 9th 06 04:27 PM
Select method of range class failed sa02000[_4_] Excel Programming 1 October 5th 05 01:20 PM
Select method of Range class failed - but why??? Orion[_2_] Excel Programming 3 December 21st 04 03:28 PM
select method of range class failed Joseph[_38_] Excel Programming 1 September 28th 04 03:21 PM
select method of range class failed Joseph[_39_] Excel Programming 0 September 28th 04 02:32 PM


All times are GMT +1. The time now is 12:14 PM.

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"