Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / November 2005

Tip: Looking for answers? Try searching our database.

Macro Help needed.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Don Schmidt - 25 Nov 2005 14:18 GMT
I have never created a macro before and need some help.

I have a Word 97 file that is a Directory of individuals, their Lodge,
e-mail address and a flag symbol in four columns of a table.

Column 1 are the names of individuals
Column 2 is their lodge (Names of cities)
Column 3 is their e-mail address
Column 4 is a flag image

I would like to be able to sort by any of the first three columns in
ascending order and the flag column in descending order. (some individuals
will have flags and the others will have a blank cell.

My goal is to be able to enter Alt+N (names), Alt+L (lodges), Alt+E and
Alt+F and have the list sort to these respective results.

I've tried several time to auto write the macro but his ol soul is doing
something very wrong for when I attempt to run a macro I get an error
report.

Help please.

Signature

Don
Vancouver, USA

Jonathan West - 25 Nov 2005 16:08 GMT
Hi Don,

You don't actually need a macro for this. provided you have put the
information into a table, you can sort the individual columns of the table
by going to Table, Sort, and using the dialog that appears.

However, if that doesn't do what you need, I'll need to see a bit more
information, such as the relevant parts of the code, which line of code the
error occurs on, and exactly what the error message is.

Signature

Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org

>I have never created a macro before and need some help.
>
[quoted text clipped - 18 lines]
>
> Help please.
Don Schmidt - 25 Nov 2005 17:53 GMT
Thanks Jonathan for responding.

When I attempt running the macro I get the following:

Runtime error 9125
String passed can't be parsed

I click Debug

Window pops up with the following:

Sub Sort_Lodges()
'
' Sort_Lodges Macro
' Macro recorded 11/25/05 by Don Schmdit
'
   Selection.Sort ExcludeHeader:=False, FieldNumber:="Column 2", _
       SortFieldType:=wdSortFieldAlphanumeric,
SortOrder:=wdSortOrderAscending, _
       FieldNumber2:="", SortFieldType2:=wdSortFieldAlphanumeric,
SortOrder2:= _
       wdSortOrderAscending, FieldNumber3:="", SortFieldType3:= _
       wdSortFieldAlphanumeric, SortOrder3:=wdSortOrderAscending,
Separator:= _
       wdSortSeparateByTabs, SortColumn:=False, CaseSensitive:=False,
LanguageID _
       :=wdLanguageNone
End Sub

Does this help?

Don

> Hi Don,
>
[quoted text clipped - 28 lines]
>>
>> Help please.
Jonathan West - 28 Nov 2005 01:01 GMT
Does it work if you cut the macro down to just this?

Sub Sort_Lodges()
'
' Sort_Lodges Macro
' Macro recorded 11/25/05 by Don Schmdit
'
   Selection.Sort ExcludeHeader:=False, FieldNumber:="Column 2", _
       SortFieldType:=wdSortFieldAlphanumeric,
SortOrder:=wdSortOrderAscending
End Sub

Signature

Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org

> Thanks Jonathan for responding.
>
[quoted text clipped - 61 lines]
>>>
>>> Help please.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.