Cell value = 1 when open

G

gavmer

Hi again all,

Am having trouble with the following. Would like to have cell d13 o
sheet FEDEX calculator value = 1 when opened.

Any ideas???

Cheers!!!!!


Private Sub Workbook_Open()
Worksheets("FEDEX calculator").Range("D13").Value = 1
End Su
 
B

Bob Phillips

Seems okay, what happens?

Any other code, such as worksheet event code, tracking the same cell?

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
G

gavmer

Hi Bob

Basically whenever my workbook opens or has its contents cleared, i would like a default value of 1 in cell D13.

Possible??

Thanks Bob!!

----- Bob Phillips wrote: ----

Seems okay, what happens

Any other code, such as worksheet event code, tracking the same cell

--

HT

Bob Phillip
... looking out across Poole Harbour to the Purbeck
(remove nothere from the email address if mailing direct
 
B

Bob Phillips

Yes, and your code (seems to) does just that, on a workbook open. The code
needs to go in the ThisWorkbook code module. Where have you put it?

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

gavmer said:
Hi Bob,

Basically whenever my workbook opens or has its contents cleared, i would
like a default value of 1 in cell D13.
 
G

gavmer

Hi Bob,

It is in the code module when the book is first opened. A few othe
codes are there also (click events).

???
 
B

Bob Phillips

Gav,

Does the code module mean ThisWorkbook? Workbook events must be in
ThisWorkbook, otherwise they are simply ignored.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
B

Bob Phillips

Good, a common mistake,

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Top