auto open message

P

pcor

Here is what I would like: Open the Excel file and the first thing I would
see is a message box that tells me what is located in cell u12
Thanks
pcor
 
P

pcor

Thanks for the VERY fast response but......
location u12 is not text but a formula that displays a date
Appreciate all the help
pcor
 
M

Michael M

Did you try Dave's Macro ??
It does exactly as you asked. It will display a formula result, date, number
etc.

HTH
Michael M
 
D

Dave Peterson

Just to add to Michael M's response...

..text tells excel to show what appears in the cell.

..value will return the value of the cell. So if your cell contains a date that
contains a special format (maybe a long date: mmmm dd, yyyy), you may really
want .text instead of .value.
 
P

pcor

Obviously I am doing something wrong.
Let me t3ell you what I am doing and you can tell me where I have gone wrong
Here is the macro as I copies it from the sheet
Sub Auto_Open()
MsgBox ThisWorkbook.Worksheets("Sheet1").Range("m6").text
End Sub
This code is located by right clicking on SHEET1/view code.
the file name is "pills.xlsm
Please help and thanks
pcor
 
D

Dave Peterson

That's not the right location.

This code goes in a General module.

With your workbook's project selected
Insert|Module

Move the code there.


Obviously I am doing something wrong.
Let me t3ell you what I am doing and you can tell me where I have gone wrong
Here is the macro as I copies it from the sheet
Sub Auto_Open()
MsgBox ThisWorkbook.Worksheets("Sheet1").Range("m6").text
End Sub
This code is located by right clicking on SHEET1/view code.
the file name is "pills.xlsm
Please help and thanks
pcor
 
P

pcor

That did it!!!!! THANKS
pcor

Dave Peterson said:
That's not the right location.

This code goes in a General module.

With your workbook's project selected
Insert|Module

Move the code there.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top