How to copy a single cell into multiple worksheets in Excel?

5

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?

user30094

Posted 2010-03-04T05:54:20.743

Reputation: 153

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 – 2010-03-04T06:09:12.157

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 – 2010-03-04T20:15:55.253

Answers

7

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.

Jordan 1GT

Posted 2010-03-04T05:54:20.743

Reputation: 785

Ah. I feel pretty stupid now. That was really easy. Thanks. – user30094 – 2010-03-05T00:30:53.087

+1 Nice answer, fits the OP's situation better than mine. – Lunatik – 2010-03-05T10:33:21.010

1You'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 – 2010-03-05T15:03:13.740

5

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)

Lunatik

Posted 2010-03-04T05:54:20.743

Reputation: 4 973