Re: $$Excel-Macros$$ define sort range

2013-08-22 Thread Peter Konijn
Thank a lot Your code works fine Kind regards Peter 2013/8/22 De Premor > try this code > > Sub sort() > Dim Str() As String > Str = Split([G4], ":") > With ActiveSheet.sort > .SortFields.Add Key:=Range(Str(0)) > .SetRange Range([G4]) > .Apply > End W

Re: $$Excel-Macros$$ define sort range

2013-08-22 Thread De Premor
try this code Sub sort() Dim Str() As String Str = Split([G4], ":") With ActiveSheet.sort .SortFields.Add Key:=Range(Str(0)) .SetRange Range([G4]) .Apply End With End Sub Pada 22/08/2013 18:39, Pekon menulis: Dear experts I hope that you can help me. I

$$Excel-Macros$$ define sort range

2013-08-22 Thread Pekon
Dear experts I hope that you can help me. In the attachment you will find an example file. I try to to sort a part of the worksheet with a macro. For some reason I cannot use a refer to cell G4 (with the range of the table to be sorted) in the macro. Who can give me the right code? Kind Re