This is my code to loop through all worksheets. I want to copy particular cell value from all the sheets and paste it to my master sheet. First i tried for one work sheet, its working fine. I modified the same code to loop through all the worksheets in the workbook. I displayed worksheets name and data which i want to copy. Its going to all the worksheets properly but i am not getting the data for worksheets except first sheet. Even its not displaying in msgbox except for first worksheet.
For Each ws In ActiveWorkbook.Worksheets
If Range("C3").Value = "" Then
Coverge_ID = Range("C2")
MsgBox Coverge_ID
ThisWorkbook.Worksheets(2).Activate
Range("A1").Offset(I, 0) = Coverge_ID
I = I + 1
Else
Coverge_ID = Range("C3")
MsgBox Coverge_ID
ThisWorkbook.Worksheets(2).Activate
Range("A1").Offset(I, 0) = Coverge_ID
I = I + 1
End If
MsgBox ws.Name
Next ws