Skip to content

Instantly share code, notes, and snippets.

@ndthanh
Created July 21, 2017 09:36
Show Gist options
  • Select an option

  • Save ndthanh/6d49058cbdd5b76813dd298d1e407eea to your computer and use it in GitHub Desktop.

Select an option

Save ndthanh/6d49058cbdd5b76813dd298d1e407eea to your computer and use it in GitHub Desktop.
Sub AutoFillSheetNames()
'Update 20131202
Dim ActRng As Range
Dim ActWsName As String
Dim ActAddress As String
Dim Ws As Worksheet
On Error Resume Next
xTitleId = "Hoc Excel Online"
Set ActRng = Application.ActiveCell
ActWsName = Application.ActiveSheet.Name
ActAddress = ActRng.Address(False, False)
Application.ScreenUpdating = False
xIndex = 0
For Each Ws In Application.Worksheets
If Ws.Name <> ActWsName Then
ActRng.Offset(xIndex, 0).Value = "='" & Ws.Name & "'!" & ActAddress
xIndex = xIndex + 1
End If
Next
Application.ScreenUpdating = True
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment