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: 258
Default Run code without opening worksheet

How can I run this code without making worksheet "Outstanding Checks"
active?

Sub Sort_Checks()
'
' Sort_Checks Macro
'

'
Sheets("Outstanding Checks").Select
Range("A5:D22").Select
ActiveWorkbook.Worksheets("Outstanding Checks").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("Outstanding Checks").Sort.SortFields.Add
Key:= _
Range("A5:A22"), SortOn:=SortOnValues, Order:=xlAscending,
DataOption:= _
xlSortNormal
With ActiveWorkbook.Worksheets("Outstanding Checks").Sort
.SetRange Range("A5:D22")
.Header = xlGuess
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
Range("A4").Select
End Sub


 
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
code does not work when opening again tweety127[_31_] Excel Programming 1 August 3rd 06 08:23 PM
run code on opening workbook and apply code to certain sheets Jane Excel Programming 7 August 8th 05 09:15 AM
Opening a template .xls with VBA code IXLINXL Excel Programming 5 December 1st 04 08:05 PM
Opening Notepad from Code Stan Excel Programming 3 July 16th 04 03:18 PM
Opening A Folder Using VB Code kiza Excel Programming 2 January 4th 04 11:27 AM


All times are GMT +1. The time now is 06:28 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"