Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Please help with "simple" code issue
I am trying to get a worksheet (named data) to automatically sort
itself when the workbook opens. It should sort according to column D. This code has been placed in the workbook code module. Private Sub workbook_open() Worksheets("data").Range(Cells(1, 1), Cells(50000, 7)).Sort Key1:=Worksheets("data").Range("D2") End Sub I ran this code about 4 or 5 times, and it worked every time. Then it stopped working for no apparent reason. I get an error when I run it. Help please. thanks. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Please help with "simple" code issue
Hello Andrew
What is the exact error? HTH Cordially Pascal "Andrew" a écrit dans le message de news: ... I am trying to get a worksheet (named data) to automatically sort itself when the workbook opens. It should sort according to column D. This code has been placed in the workbook code module. Private Sub workbook_open() Worksheets("data").Range(Cells(1, 1), Cells(50000, 7)).Sort Key1:=Worksheets("data").Range("D2") End Sub I ran this code about 4 or 5 times, and it worked every time. Then it stopped working for no apparent reason. I get an error when I run it. Help please. thanks. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Please help with "simple" code issue
On Oct 18, 12:46 am, "papou"
wrote: Hello Andrew What is the exact error? HTH Cordially Pascal "Andrew" a écrit dans le message de news: om... I am trying to get a worksheet (named data) to automatically sort itself when the workbook opens. It should sort according to column D. This code has been placed in the workbook code module. Private Sub workbook_open() Worksheets("data").Range(Cells(1, 1), Cells(50000, 7)).Sort Key1:=Worksheets("data").Range("D2") End Sub I ran this code about 4 or 5 times, and it worked every time. Then it stopped working for no apparent reason. I get an error when I run it. Help please. thanks. Pascal, I've run the code twenty times without fail. So I cannot get an error message for you. Maybe it is healed. Thanks. Andrew |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
simple code with "abc" & "*" | Excel Discussion (Misc queries) | |||
How to have a macro simply issue the "find" command or "control f: | Excel Programming | |||
Revisiting "New issue with "With" statment" post from 6/7/07 | Excel Programming | |||
Can you "duplicate" "copy" listboxes and code to multiple cells? | Excel Programming | |||
Looking for VB code to test for "RING" , "BUSY" disconnects or other signals | Excel Programming |