View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Capinvest Capinvest is offline
external usenet poster
 
Posts: 5
Default Expected:expression

I tryed that and now I get the following error:

Compile error
Syntax error

I would appericiate any further help. Thanks.

-----Original Message-----
Change

Worksheets("Home").Range("C8:C27").Sort
Key1: = Worksheets("Home").Range("C8")
XlSortOrder.xlAscending


to

Worksheets("Home").Range("C8:C27").Sort
Key1: = Worksheets("Home").Range("C8"),
Order1:= xlAscending


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Capinvest" wrote in message
...
I am trying to sort a combobox alphabetically in excel
using vba. I have the following code behind the

combobox:

Private Sub ClientList_Change()
' this sorts the names alphabetically

Worksheets("Home").Range("C8:C27").Sort
Key1: = Worksheets("Home").Range("C8")
XlSortOrder.xlAscending

End Sub

I get an error everytime I try to run it. The error

says:

Compile error: Expected:expression

I would appericate any help with this issue.



.