VB - when spreadsheet opens setting a default value

Experts,

I have a spreadsheet where the user can click on columns "A11" - "A33" to select what information they want to see.  How can I have the spreadsheet default to "A11" when first opened.

In addition, I would like column "K9"  to default to "105" when sheet is first opened.
moriniaAdvanced Analytics AnalystAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

KimputerCommented:
Pure VBA, in the excel itself:

Private Sub Workbook_Open()

Cells(11, 1).Select
Cells(9, 11).Value = 105

End Sub

Open in new window

0
moriniaAdvanced Analytics AnalystAuthor Commented:
Kimputer,

I am sorry,  I forgot to mention I have three worksheets in the workbook that I would like to set default values.  How do I specify the respective worksheet?
0
KimputerCommented:
The original code was meant for ThisWorkbook.

The following code has to go into each sheet:

Private Sub Workbook_Open()

Cells(11, 1).Select
Cells(9, 11).Value = 105

End Sub

Open in new window

0
Martin LissOlder than dirtCommented:
Put this in 'ThisWorkbook'

Private Sub Workbook_Open()

Dim ws As Worksheet

    
For Each ws In Worksheets
    Range("K9").Value = 105
Next

Sheets("Sheet1").Activate
Range("A11").Select

End Sub

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Martin LissOlder than dirtCommented:
I'm glad I was able to help.

In my profile you'll find links to some articles I've written that may interest you.
Marty - MVP 2009 to 2015
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.