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: 8
Default Macro is choosing by tab name?

Hi -- I have a macro I recorded that's doing some formatting on a report.
One part of the macro is looking at the name of the worksheet, but it's not
always the same name. Is there any way to alter this code so it works no
matter what the worksheet name is? It really just needs to select a
particular column, I'm not sure why it's looking at the worksheet name at
all. Thanks for any advice!

-Dawn

ActiveWorkbook.Worksheets("Docket_Report 1 ").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("Docket_Report 1 ").Sort.SortFields.Add _
Key:=Range("H2"), SortOn:=xlSortOnValues, Order:=xlAscending,
DataOption _
:=xlSortTextAsNumbers
With ActiveWorkbook.Worksheets("Docket_Report 1 ").Sort
.SetRange Range("A3:I45")
.Header = xlNo
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
 
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
Choosing which macro to call NickHK Excel Programming 0 December 13th 06 02:46 AM
Choosing printer in a printing macro Werner[_18_] Excel Programming 1 July 5th 05 04:52 PM
Choosing printer in a printing macro \Jean-Jerome Doucet via OfficeKB.com\ Excel Programming 2 July 5th 05 04:31 PM
Help on choosing the right way Antonis Excel Programming 2 September 4th 04 08:45 PM
choosing from a list in VB Mary Agnes Excel Programming 0 February 5th 04 03:51 PM


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