Home |
Search |
Today's Posts |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Here's another example of my code (in a VSTO 2005 workbook):
Private Sub ThisWorkbook_Startup(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Startup Try Dim Bl As Excel.Worksheet = CType(Me.ActiveSheet, Excel.Worksheet) Bl.Range("A1:D6").Select() Dim x As Object = Bl.Range("A1:D6").Sort(Key1:=Bl.Cells(1, 3)) MessageBox.Show(x.ToString) Catch ex As Exception Finally Me.Save() End Try End Sub The messagebox "kkarre" wrote: Hello all, I'm trying to sort a range on a column containing some empty cells (to get them last and later get rid of these rows) Sheet like this: Header1 Header2 Header3 Header4 etc. 1 qw xxx 2 qw 123456 yyy 3 qw 234567 zzz 4 er aaa 5 er 345678 bbb Range("A1:W" & LastRow).Sort(Range("C3")) doesn't seem to do the trick. Sometimes nothing happens, sometimes it sorts the columns although sorting rows is default! Any code that DOES sort a range's rows on the third column would be greatly appreciated! /kk |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
harder than i thought | Excel Discussion (Misc queries) | |||
Don't think it's possible, but I thought I would ask. | Excel Worksheet Functions | |||
This is A LOT harder than I thought it would be | Excel Discussion (Misc queries) | |||
On second thought ... | New Users to Excel | |||
out of the ordinary question | Excel Programming |