Last active
July 21, 2017 10:13
-
-
Save ndthanh/32f61aa994d7fef07e2f72cf484993da to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub InsertCheckBoxes() | |
'Update 20140506 | |
Dim Rng As Range | |
Dim WorkRng As Range | |
Dim Ws As Worksheet | |
On Error Resume Next | |
xTitleId = "Hoc Excel Online" | |
Set WorkRng = Application.Selection | |
Set WorkRng = Application.InputBox("Range", xTitleId, WorkRng.Address, Type:=8) | |
Set Ws = Application.ActiveSheet | |
Application.ScreenUpdating = False | |
For Each Rng In WorkRng | |
With Ws.CheckBoxes.Add(Rng.Left, Rng.Top, Rng.Width, Rng.Height) | |
.Characters.Text = Rng.Value | |
End With | |
Next | |
WorkRng.ClearContents | |
WorkRng.Select | |
Application.ScreenUpdating = True | |
End Sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment