KP_SoCal
Board Regular
- Joined
- Nov 17, 2009
- Messages
- 116
I have an excel workbook with tabs: Sheet1, Sheet2, Sheet3, Sheet 4, Sheet 5, Sheet 6, and Sheet7.
For Sheets 1 thru 5, I need cell A2 on a newly activated sheet to populate with the value on the most recent worksheet. Sheet1 holds the default value of “Widget1” in A2. So if I click on any Sheet between 2 and 5 (Sheets 6 and 7 should be excluded in criteria), cell A2 would populate with “Widget1”.
However, if I decide to populate cell A2 on Sheet3 with “Widget3”, then if I click back to Sheet1 it would populate with “Widget3” in call A2. Does this make sense?
I’ll probably need something like this code below, but I’m just not sure how to piece it together to make it work in the way I described above. Any advice is greatly appreciated.
For Sheets 1 thru 5, I need cell A2 on a newly activated sheet to populate with the value on the most recent worksheet. Sheet1 holds the default value of “Widget1” in A2. So if I click on any Sheet between 2 and 5 (Sheets 6 and 7 should be excluded in criteria), cell A2 would populate with “Widget1”.
However, if I decide to populate cell A2 on Sheet3 with “Widget3”, then if I click back to Sheet1 it would populate with “Widget3” in call A2. Does this make sense?
I’ll probably need something like this code below, but I’m just not sure how to piece it together to make it work in the way I described above. Any advice is greatly appreciated.

Code:
Dim wsSheet As Worksheet
Application.ScreenUpdating = False
For Each wsSheet In ThisWorkbook.Worksheets
If wsSheet.CodeName = Then
Else
End If
Next wsSheet
Application.ScreenUpdating = True