[mso] Re: Sort Excel Spreadsheet

Great Question George!!!

The way I would go is to write a user function to strip numbers from
the name and put that in an extra column.. and then sort by that
column and then delete it.

I admit it's still putting in an extra column... but at least your
friend doesn't have to work too hard!

Problem is all of the dashes and commas that need to disseaper.

Something like...

Function fncStripChrs(strpString As String)
' Strip some characters

Dim intlM As Integer
Dim strlS As String

strlS = ""
For intlM = 1 To Len(strpString)
  Select Case Asc(Mid(strpString, intlM, 1))
  Case 13, 7, 10, 9, 150, 147
  Case Else
    strlS = strlS & Mid(strpString, intlM, 1)
  End Select
Next
fncStripCtlChrs = strlS
'
**********************************************************************
*
End Function

This is a function I actually use. It's set to strip returns and some
control chrs but the line...

Case 13, 7, 10, 9, 150, 147

can be set to strip numbers dahes and commas if you like. It can also
be set to stop at the the first space if you choose.

HTH
Lisa

> I have a friend that has a list of chemicals in an Excel
> spreadsheet.  There
> are several hundred rows in this list.  The chemical names
> sometimes start
> with a number and other times with a letter
> (3-Bromo-1,1,1-trifluoropropane,
> 3,5-Difluoronitro benzene, octafluorocyclopentane).
> Sometimes the first
> letter is capitalized and sometimes it is lower case.  He
> wants to sort the
> list alphabetically, that is by the first letter in the
> name whether it has
> a number in front of it or not. I have tried using the sort
> and filter but
> both of them sort the numbered names first and then the
> lettered names next.
> How can I get Excel to ignore the numbers w/o having to put
> them in a
> separate column when sorting?

--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.394 / Virus Database: 268.10.1/391 - Release Date:
18/07/2006


*************************************************************
You are receiving this mail because you subscribed to mso@xxxxxxxxxxxxx or 
MicrosoftOffice@xxxxxxxxxxxxxxxx

To send mail to the group, simply address it to mso@xxxxxxxxxxxxx

To Unsubscribe from this group, visit the group's homepage and use the dropdown 
menu at the top.  This will allow you to unsubscribe your email address or 
change your email settings to digest or vacation (no mail).
http://www.freelists.org/webpage/mso

To be able to use the files section for sharing files with the group, send a 
request to mso-moderators@xxxxxxxxxxxxx and you will be sent an invitation with 
instructions.  Once you are a member of the files group, you can go here to 
upload/download files:
http://www.smartgroups.com/vault/msofiles

If you are using Outlook and you see a lot of unnecessary code in your email 
messages, read these instructions that explain why and how to fix it:
http://personal-computer-tutor.com/abc3/v28/greg28.htm
*************************************************************

Other related posts: