Copy Employee IDs to same cell in multiple worksheets.

[Closed]
Report
-
Posts
1320
Registration date
Thursday July 24, 2014
Status
Moderator
Last seen
October 8, 2021
-
Hello sir

I have 400 sheets in workbook in first work sheet from I2 to I400 i have employee numbers Which i want to copy automatically to all 399 sheets to cell C15 one by one

Below is the example

123
876
788
667

Sheet2 in cell C15 123
Sheet3 in cell C15 876
Sheet4 in cell C15 788

Can anyone help me with solution rather than i do manually all 400 sheets

Thanks





1 reply

Posts
1320
Registration date
Thursday July 24, 2014
Status
Moderator
Last seen
October 8, 2021
239
Hello Srinivas,

Without knowing how your work book is set up, I assume that the 399 employee sheets are named with the employee numbers. Hence, I think that the following code, placed in a standard module and assigned to a button, should work for you:-

Sub InsertIDs()

Dim ws As Worksheet

Application.ScreenUpdating = False

i = 2

For Each ws In Worksheets
       If ws.Name <> "Sheet1" Then
         ws.[C15].Value = Sheet1.Cells(i, 9).Value
           i = i + 1
      End If
Next ws

Application.ScreenUpdating = True
MsgBox "All done!", vbExclamation

End Sub


I hope that this helps.

Cheerio,
vcoolio.