LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 26
Default Avoid .activate

I have a piece of code as below that works fine, but I can't find an
alternative that works, avoiding the two .Activate lines .

I've tried with...end with, but it gives an error.

Any suggestions?


Dim bottomRow As Long

bottomRow = Sheets("Scores").Cells(Rows.Count, 1).End(xlUp).Row

Sheets("Results").Activate
Sheets("Results").Range(Cells(3, 1), Cells(bottomRow,6)).Copy
Sheets("Ladder").Range("b3").PasteSpecial Paste:=xlValues

Sheets("Ladder").Activate
Sheets("Ladder").Range(Cells(3, 2), Cells(bottomRow, 7)) _
.Sort Key1:=Range("g3"), Order1:=xlDescending, Header:=xlNo, _
OrderCustom:=1, MatchCase:=False,Orientation:=xlTopToBottom

--
Gordon Rainsford

London UK
 
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
Avoid #div/0! Harsh Bahal Excel Worksheet Functions 8 March 10th 09 05:47 AM
IF isna to avoid #N/A Learning Excel Excel Discussion (Misc queries) 5 June 8th 08 02:48 AM
How to avoid #DIV/0 from appearing Chris921 Excel Discussion (Misc queries) 1 March 1st 06 05:12 PM
what is this, how do I avoid it? datadude1959 Excel Discussion (Misc queries) 2 September 29th 05 06:05 PM
avoid div by zero sapta Excel Programming 2 October 7th 03 06:02 AM


All times are GMT +1. The time now is 07:42 AM.

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"