Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Cells.Select won't work!!!
Hei Neil
You don't have to activate or select anything to sort a table. If you explain what this CSV = ActiveCell.Value Windows(CSV).Activate does, I could perhaps write you a working demo. HTH. best wishes Harald "Neil Cash" skrev i melding ... I have a workbook that contains a macro that opens a file. Then the file is sorted the way it should. But I get an error on the Cells.Select command: Run-time error '1004': Select method of Range class failed Here's what my code looks like: ActiveWorkbook.Save Range("D4").Select CSV = ActiveCell.Value Windows(CSV).Activate Cells.Select Selection.Sort Key1:=Range("C2"), Order1:=xlAscending, Key2:=Range("A2") _ , Order2:=xlAscending, Header:=xlGuess, OrderCustom:=1, MatchCase:= _ False, Orientation:=xlTopToBottom, DataOption1:=xlSortNormal, DataOption2 _ :=xlSortNormal Is there a different way to select all the cells in the workbook? Does anyone have any ideas about what I'm missing? Thanks in advance. I don't know if it matters, but the file that is being sorted is a csv file. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Up down arrow keys do not select cells if select locked cells unch | Excel Discussion (Misc queries) | |||
Macro to select cells without a certain value and select a menu it | Excel Worksheet Functions | |||
Can't get VBA to work without select | Excel Discussion (Misc queries) | |||
how do you "select locked cells" w/o "select unlocked cells"? | Excel Discussion (Misc queries) | |||
Select an array of cells and paste to separate worksheet - 2nd post - 1st didn't work!! | Excel Programming |