LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 28
Default sort data on custom format

thanks, it works fine.

shaji

"Luke M" wrote:

First, insert a blank row to the right of your data. Next, right click on
sheet tab, view code, and paste this in:

'========
Sub DetermineFormat()

For Each cell In Selection
If cell.NumberFormat = """""0.00"" Cr""" Then
cell.Offset(0, 1).Value = "Credit"
ElseIf cell.NumberFormat = """""0.00"" Dr""" Then
cell.Offset(0, 1).Value = "Debit"
End If
Next cell
End Sub
'=======

Now, back in your workbook, select all the cells with your data in them, and
then run this macro (You can press Alt+F8 to bring up the macro menu). Your
data now has labels, and you can use the labels to sort, by descending, your
data.

--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"shaji" wrote:

Hi !

I am exporting data from my accounting software to excel. The column in
which the amount is showing is custom formatted to ''''0.00" Cr" for Credit
amounts and ""0.00" Dr" for debit amounts. I want sort all debit amounts in
the top of the list and Credit amounts in bottom. How can I sort the data
based on custom formatting.

thanks in advance.

shaji

 
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
Need help with converting CUSTOM format/TEXT format to DATE format Deo Cleto Excel Worksheet Functions 6 June 2nd 09 08:14 PM
Format Cell as custom type but data doesn't display like I custom. ToMMie Excel Discussion (Misc queries) 6 September 11th 08 08:31 AM
How do I sort data by Month on the date format like (02/04/97)? Winnie Excel Discussion (Misc queries) 5 October 14th 05 07:16 PM
Excel sort by Fill Color by custom list sort Dash4Cash Excel Discussion (Misc queries) 2 July 29th 05 10:45 PM
Custom Format and Data Validation Q John Excel Worksheet Functions 1 January 6th 05 05:56 PM


All times are GMT +1. The time now is 10:01 PM.

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"