Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
add comment

2 Answers 2

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
1  
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
add comment

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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.