Skip to content

Instantly share code, notes, and snippets.

@ndthanh
Created July 22, 2017 17:12
Show Gist options
  • Save ndthanh/a9b4468331c10725028a5ef536873d84 to your computer and use it in GitHub Desktop.
Save ndthanh/a9b4468331c10725028a5ef536873d84 to your computer and use it in GitHub Desktop.
Sub AddTextOnLeft()
'Updateby20131128
Dim Rng As Range
Dim WorkRng As Range
Dim addStr As String
On Error Resume Next
xTitleId = "Hoc Excel Online"
Set WorkRng = Application.Selection
Set WorkRng = Application.InputBox("Range", xTitleId, WorkRng.Address, Type:=8)
addStr = Application.InputBox("Add text", xTitleId, "", Type:=2)
For Each Rng In WorkRng
Rng.Value = addStr & Rng.Value
Next
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment