(How to use Sheet name instead of Tab name in Excel VBA)?
How do I replace the tab's name ('Electrical') with the actual Sheet name (Sheet 11)? Whenever I do it doesn't work, here is the working code below, just need to use the sheet name:
Private Sub Worksheet_Change(ByVal Target As Excel.Range) With Target
If .Address(False, False) = "D107" Then
If IsEmpty(.Value) Then
Application.EnableEvents = False
.Formula = "=Electrical!I181"
Application.EnableEvents = True
End If
End If
This code is placed in the active sheet and it simply inputs a cell reference from another tab 'Electrical' tab (cell I181) unless the target cell (D107) already has a value (is not blank). And it should input it again if I clear (delete) the value in the target cell (D107).
Any help would be great - Thanks much!