Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Search for a string, find the column and use that column to sort by
I have a data dump into excel, but the info doesn't dump into the same
column everytime, so I need to search the sheet for that string and once I find the column, use that column to sort the data. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Search for a string, find the column and use that column to sort by
One way you may try is to record a macro while doing a manual
editFINDsort. Then modify. -- Don Guillett Microsoft MVP Excel SalesAid Software wrote in message ps.com... I have a data dump into excel, but the info doesn't dump into the same column everytime, so I need to search the sheet for that string and once I find the column, use that column to sort the data. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Search for a string, find the column and use that column to sort by
Sub findSort()
Dim findWhat As String, col As Integer findWhat = "Johnny" On Error GoTo errHandler col = Cells.Find(What:=findWhat, After:=Cells(1, 1), _ LookIn:=xlFormulas, LookAt:=xlWhole, _ SearchOrder:=xlByRows, SearchDirection:=xlNext, _ MatchCase:=False, SearchFormat:=False).Column Cells.Sort Key1:=Columns(col), Order1:=xlAscending, _ Header:=xlGuess, OrderCustom:=1, MatchCase:=False, _ Orientation:=xlTopToBottom, DataOption1:=xlSortNormal Exit Sub errHandler: MsgBox findWhat & " not found" End Sub wrote: I have a data dump into excel, but the info doesn't dump into the same column everytime, so I need to search the sheet for that string and once I find the column, use that column to sort the data. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Search for a string, find the column and use that column to sort by
Thanks a lot. I should have said filter instead of sort, but I think
I got it from here. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Search text string for ssn and copy to new column | Excel Discussion (Misc queries) | |||
Please let Excel sort by string value within the cell/column. | Excel Programming | |||
search a string withing a string : find / search hangs | Excel Programming | |||
URGENT -- search in string for a value in another column, if found, return value from next column | Excel Programming | |||
Search column - return row found in long text string | Excel Programming |