## How to create excel checklist box with VBA?

Apply the below VBA codes against a specific excel spreadsheet to get the checklist box to automatically appear before each text/number typed into a cell.

```Private Sub Worksheet_Change(ByVal Target As Range)
Application.ScreenUpdating = False
Dim cell As Range
If Target.Row = 2 Then Exit Sub
If Target.Cells.Count > 1 Then
For Each cell In Target
Next cell
Else
Set cell = Target
End If
Application.ScreenUpdating = True
End Sub

Dim CLeft As Double, CTop As Double, CHeight As Double, CWidth As Double
Dim chkbx As CheckBox
If cell.Value <> "" Then
With cell.Offset(0, -1)
CLeft = Cells(.Row, .Column).Left + Cells(.Row, .Column).Width
CTop = Cells(.Row, .Column).Top
CHeight = Cells(.Row, .Column).Height
CWidth = Cells(.Row, .Column).Width
End With
With Selection
.Caption = ""
.Value = xlOff
End With
cell.Offset(1, 0).Select
Else
For Each chkbx In ActiveSheet.CheckBoxes
If cell.Top = chkbx.Top Then
chkbx.Delete
cell.Font.Strikethrough = False
End If
Next
cell.Offset(1, 0).Select
End If
End Sub

```
{"ft_lang_label":"__label__en","ft_lang_prob":0.5029195,"math_prob":0.89696413,"size":1194,"snap":"2019-43-2019-47","text_gpt3_token_len":306,"char_repetition_ratio":0.12184874,"word_repetition_ratio":0.0,"special_character_ratio":0.23450586,"punctuation_ratio":0.21544716,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9757983,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2019-11-18T17:26:47Z\",\"WARC-Record-ID\":\"<urn:uuid:2fb5745a-9e96-4c90-82d4-5bebf8b87170>\",\"Content-Length\":\"26529\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:15e92356-0def-4e89-adc8-cb7e695400e8>\",\"WARC-Concurrent-To\":\"<urn:uuid:f8666266-741e-443b-8b6f-3e238fb0698b>\",\"WARC-IP-Address\":\"146.66.91.135\",\"WARC-Target-URI\":\"http://www.ledgerpress.com.au/446-2/\",\"WARC-Payload-Digest\":\"sha1:OLXOMCNI6Z2YIYXJALEU2RNKQCGGW5R5\",\"WARC-Block-Digest\":\"sha1:IXNQ673VVFURNQTDOAQFMD4NE5DJIQF2\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2019/CC-MAIN-2019-47/CC-MAIN-2019-47_segments_1573496669809.82_warc_CC-MAIN-20191118154801-20191118182801-00438.warc.gz\"}"}