show info when workbook opens

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am writing a VB macro for an excel spreadsheet. I want certain cells to
contain text and numbers when someone opens the workbook. Also I want a
button to be shown when someone opens the workbook. I do not want to use a
userform but I want the button and the text på be directly on the
spreadsheet. I seem to fail with the workbook open sub. My code for this part
is:

Private Sub Workbook_Open()
Worksheets("Setup").Range("b19") = "open"
Worksheets("Setup").Range("b20") = "sesame"
End Sub

I do not know how to get this sub to perform the instructions. help!!
 
Hi April27,

Your code works for me, providing that it is placed in the workbook's
ThisWorkbook module - not in a standard module.

As for the button, although you do not say what the button is to do, why not
insert the button manually?
 

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

Back
Top