Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sort order based on value in a cell

Status
Not open for further replies.

TheBlondOne

Programmer
May 22, 2001
346
GB
Hi guys, hoping someone can help me with this.

The situation i've got is that I need to sort A-Z if a certain cell contains a value otherwise I need to leave the sort order alone.

Basically i've got 4 columns, 1 displaying an area, 1 displaying a projected value, 1 displaying a YTD value and the final column displays the pecentage difference.

I'm using Xcelsius to populate a cell with the value A-Z or Normal.

So what I'm stuck with is how I can automatically sort or leave alone the selected cells depending on the value being passed from Xcelsius.

Can anyone help with this?

Hope that makes senes.


Thanks in advance


-Steve


"if at first you don't succeed, sky diving is not for you"!!! :eek:)
 
Record a macro of you sorting the data.

Then right click the sheet tab and select view code.
Change the left hand drop down to Worksheet and then right hand dropdown to Calculate say.

Then insert the code:

Application.EnableEvents=False
If Cells(x,y)="A-Z" then Call <name of recorded macro>
Application.EnableEvents=true

Here x,y refer to the co-ordinates of the cell that will illustrate when you have to sort the data. It will be checked every time the worksheet recalculates.

Fen
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top