ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Macro that sort on clnm populated by indirect (https://www.excelbanter.com/excel-discussion-misc-queries/132966-macro-sort-clnm-populated-indirect.html)

[email protected]

Macro that sort on clnm populated by indirect
 
Hi!
Any help is much appreciated!!
I have a form that has a sales column that populates by an indirect
formula that pulls data from different worksheets based on dynamic
info (if A=0, then this worksheet, etc). I have then setup a macro to
sort on this column-when i setup the macro the indirect pulled from
WorksheetA.
However, when the Indirect formula pulls from WorksheetB the data is
displayed properly (formula resulting what i expect), but when i hit
the button to run the macro it still sorts based on WorksheetA.

the column that Im sorting on has this formula
=IF(W110,(SUMIF(INDIRECT(""&$T$5&""&""&$AY$5&""), $H11,INDIRECT(""&$T
$5&""&""&$AY$4&""))),0)
First checking that there is a sales plan
sumif, dynamically pulling the sheetname and column to pull from.

Any ideas on what Im doing wrong?
thanks soo much in advance-Ive given myself a headache!


chad

Macro that sort on clnm populated by indirect
 
what does your sort macro look like?

-chad

" wrote:

Hi!
Any help is much appreciated!!
I have a form that has a sales column that populates by an indirect
formula that pulls data from different worksheets based on dynamic
info (if A=0, then this worksheet, etc). I have then setup a macro to
sort on this column-when i setup the macro the indirect pulled from
WorksheetA.
However, when the Indirect formula pulls from WorksheetB the data is
displayed properly (formula resulting what i expect), but when i hit
the button to run the macro it still sorts based on WorksheetA.

the column that Im sorting on has this formula
=IF(W110,(SUMIF(INDIRECT(""&$T$5&""&""&$AY$5&""), $H11,INDIRECT(""&$T
$5&""&""&$AY$4&""))),0)
First checking that there is a sales plan
sumif, dynamically pulling the sheetname and column to pull from.

Any ideas on what Im doing wrong?
thanks soo much in advance-Ive given myself a headache!



[email protected]

Macro that sort on clnm populated by indirect
 
On Mar 2, 9:04 am, Chad wrote:
what does your sort macro look like?

-chad



" wrote:
Hi!
Any help is much appreciated!!
I have a form that has a sales column that populates by an indirect
formula that pulls data from different worksheets based on dynamic
info (if A=0, then this worksheet, etc). I have then setup a macro to
sort on this column-when i setup the macro the indirect pulled from
WorksheetA.
However, when the Indirect formula pulls from WorksheetB the data is
displayed properly (formula resulting what i expect), but when i hit
the button to run the macro it still sorts based on WorksheetA.


the column that Im sorting on has this formula
=IF(W110,(SUMIF(INDIRECT(""&$T$5&""&""&$AY$5&""), $H11,INDIRECT(""&$T
$5&""&""&$AY$4&""))),0)
First checking that there is a sales plan
sumif, dynamically pulling the sheetname and column to pull from.


Any ideas on what Im doing wrong?
thanks soo much in advance-Ive given myself a headache!- Hide quoted text -


- Show quoted text -


Hi Chad!
I just used the record macro button in the form...I'm not a
programmer..so I'm really out of my realm!!
Record macro then hit Data-Sort etc.

When I look at the code it created i think this is the part that does
the sort.

Range("A10:BB109").Select
Selection.Sort Key1:=Range("AK10"), Order1:=xlDescending,
Key2:=Range( _
"H10"), Order2:=xlAscending, Header:=xlGuess, OrderCustom:=1,
MatchCase _
:=True, Orientation:=xlTopToBottom

thanks for any insight!



All times are GMT +1. The time now is 11:52 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com