Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 130
Default 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.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 130
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
simple code with "abc" & "*" Jack Sons Excel Discussion (Misc queries) 2 July 28th 09 11:45 PM
How to have a macro simply issue the "find" command or "control f: Charles Adams Excel Programming 3 February 6th 09 06:34 PM
Revisiting "New issue with "With" statment" post from 6/7/07 robs3131 Excel Programming 2 June 12th 07 04:27 AM
Can you "duplicate" "copy" listboxes and code to multiple cells? HotRod Excel Programming 1 September 1st 04 05:03 PM
Looking for VB code to test for "RING" , "BUSY" disconnects or other signals BruceJ[_2_] Excel Programming 3 November 20th 03 01:55 AM


All times are GMT +1. The time now is 09:12 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"