Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Excel sort column with indirectly referenced dymanic worksheet

I have searched for help everywhere, please please help me!!!

In my excel file, a column is populated by an indirect
formula that pulls data from different worksheets based on dynamic
info (if A=0, then WorksheetA, if A=1 WorksheetB, etc).
I have then setup a macro to sort a table on this column (just by
doing record macro, data sort etc- no programming involved)
When i created the macro, the indirect pulled from WorksheetA.
However, when the Indirect formula pulls from WorksheetB the data is
still sorted it by WorksheetA after executing the macro, but the cells
are displaying what i expect-from worksheetb. Therefore the indirect
formula is correct.

Is it possible for the macro to understand the sorting based on
different worksheets?

The column that Im sorting on has this formula:
=IF(W110,(SUMIF(INDIRECT(""&$T$5&""&""&$AY$5&""), $H11,INDIRECT(""&$T
$5&""&""&$AY$4&""))),0)
.........If something isnt 0, sumif, dynamically pulling the sheetname
and column to get data from.

Then the code that was created that relates to that sort in the macro
is this:
Range("A10:BB109").Select
Selection.Sort Key1:=Range("AK10"), Order1:=xlDescending,
Key2:=Range( _
"H10"), Order2:=xlAscending, Header:=xlGuess, OrderCustom:=1,
MatchCase _
:=True, Orientation:=xlTopToBottom


-desperately seeking help.
-Missy

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Excel sort column with indirectly referenced dymanic worksheet

It makes no difference where the data comes from, if it ends up in the
location you are sorting, it will get sorted. In you case, Range A10:BB109,
will be sorted based on the data in columns AK (Descending) and H (Ascending)
respecively. The macro is doing its job.

" wrote:

I have searched for help everywhere, please please help me!!!

In my excel file, a column is populated by an indirect
formula that pulls data from different worksheets based on dynamic
info (if A=0, then WorksheetA, if A=1 WorksheetB, etc).
I have then setup a macro to sort a table on this column (just by
doing record macro, data sort etc- no programming involved)
When i created the macro, the indirect pulled from WorksheetA.
However, when the Indirect formula pulls from WorksheetB the data is
still sorted it by WorksheetA after executing the macro, but the cells
are displaying what i expect-from worksheetb. Therefore the indirect
formula is correct.

Is it possible for the macro to understand the sorting based on
different worksheets?

The column that Im sorting on has this formula:
=IF(W110,(SUMIF(INDIRECT(""&$T$5&""&""&$AY$5&""), $H11,INDIRECT(""&$T
$5&""&""&$AY$4&""))),0)
.........If something isnt 0, sumif, dynamically pulling the sheetname
and column to get data from.

Then the code that was created that relates to that sort in the macro
is this:
Range("A10:BB109").Select
Selection.Sort Key1:=Range("AK10"), Order1:=xlDescending,
Key2:=Range( _
"H10"), Order2:=xlAscending, Header:=xlGuess, OrderCustom:=1,
MatchCase _
:=True, Orientation:=xlTopToBottom


-desperately seeking help.
-Missy


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
Want blank cell displayed if indirectly referenced value is zero Pierre Excel Worksheet Functions 3 May 5th 08 08:56 PM
Excel 2003 - How do I sort subjects in a worksheet by column? computerilliterate! Excel Worksheet Functions 0 November 10th 06 01:31 AM
Sort referenced sheets together! Addy Excel Worksheet Functions 3 January 12th 06 02:47 PM
Need to indirectly reference columns 26 using A1 notation based on numeric column number- how to? KR Excel Worksheet Functions 5 October 26th 05 07:08 PM
Getting value from an unopened file (indirectly referenced) learnexcel Excel Programming 11 July 27th 05 01:36 AM


All times are GMT +1. The time now is 09:26 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"