Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have about 30 worksheets, and I need to put my name on the top left corner (cell A1). Is there an easy way to do this without having to write it or paste it into every worksheet?

share|improve this question
Not going to write this as an answer - but unless you need to do this more than a few times, I would just get started now as it would be quicker just to do it yourself compared to looking for a solution. – William Hilsum Mar 4 '10 at 6:09
haha thanks for the tip, but this is a recurring task. I've had to do it manually many times now, and would really like a shortcut. – user30094 Mar 4 '10 at 20:15
up vote 6 down vote accepted

Select all the worksheets (select the first sheet, hold shift, select the last sheet)

Type your name in A1

Hit Enter.

This will do it for the non-code people.

share|improve this answer
Ah. I feel pretty stupid now. That was really easy. Thanks. – user30094 Mar 5 '10 at 0:30
+1 Nice answer, fits the OP's situation better than mine. – Lunatik Mar 5 '10 at 10:33
You're welcome and thank both of you. To make it simpler, I forgot that if you rt click on a sheet tab there is a "select all sheets" option. – Jordan 1GT Mar 5 '10 at 15:03

This should do it:

Sub PutMyNameInA1()
    Dim w As Worksheet

    For Each w In ThisWorkbook.Worksheets
        w.Range("A1") = "My Name"
    Next w
End Sub

The code should be put in a standard code module. (Alt+F11, Insert>Module, paste this in, change name in quotes, Run/F5 to execute)

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .