Auto_Open only on initial file open

  • Thread starter Thread starter Joe Granda
  • Start date Start date
J

Joe Granda

I have a spreadsheet that uses CB macro Auto_Open today
that makes a data request and populates my spreadsheet
the first time it is open. However, it does not rerun
this macro on subequent openings of this file. This is
my desired result.

I am creating a new spreadsheet that also populates
itself with a new set of data. However, every time I
save and open the file, it adds in more data and moves
the existing data to its right. This is not the desired
result. Is there a setting I am missing or should I use
a different command than Auto_Open. I do want this macro
to run the first time I open the file but just not
subsequent requests.

Thanks for your help.
 
perhaps you could add the following line of code at the beginning of the
Auto_Open macro:

If Not IsEmpty(Worksheets("Sheet1").Range("A1").Value) Then Exit Sub

Where A1 is a cell that is populated when the file is opened for the first
time.

Gareth
 
Running a query?




--
John
johnf 202 at hotmail dot com


| I have a spreadsheet that uses CB macro Auto_Open today
| that makes a data request and populates my spreadsheet
| the first time it is open. However, it does not rerun
| this macro on subequent openings of this file. This is
| my desired result.
|
| I am creating a new spreadsheet that also populates
| itself with a new set of data. However, every time I
| save and open the file, it adds in more data and moves
| the existing data to its right. This is not the desired
| result. Is there a setting I am missing or should I use
| a different command than Auto_Open. I do want this macro
| to run the first time I open the file but just not
| subsequent requests.
|
| Thanks for your help.
 
Back
Top