Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Adding checkbox on a row when data is entered in first column of that row
I am using the following code to add a checkbox in column G of a
certain row every time a user enters data in that row. Somehow the actual checkbox appears four cells above the actual cell and I cannot seem to figure out why. Any help would be appreciated! Thanks, Paul PS Sorry I also posted this in the wrong group. Private Sub Worksheet_Change(ByVal Target As Excel.Range) If Target.Count 1 Then Exit Sub If Target.Column = 1 Then If IsEmpty(Target) Then Exit Sub Set rng = Cells(Target.Row, "G") ' Check if there is already a checkbox For Each obj In ActiveSheet.OLEObjects If TypeOf obj.Object Is MSForms.CheckBox Then If obj.TopLeftCell.Address = rng.Address Then Exit Sub End If End If Next With ActiveSheet.OLEObjects.Add( _ ClassType:="Forms.CheckBox.1", _ Link:=False, _ DisplayAsIcon:=False, _ Left:=rng.Left, _ Top:=rng.Top, _ Width:=rng.Width, _ Height:=rng.Height) .Object.Caption = "" .LinkedCell = rng.Address .Object.Value = False End With Application.ScreenUpdating = True End If End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Adding entries if date entered in another column | Excel Worksheet Functions | |||
Adding rows once data is entered | Excel Discussion (Misc queries) | |||
adding text that appears after the entered data | Setting up and Configuration of Excel | |||
How do I change data that has been entered in a column to a row? | Excel Discussion (Misc queries) | |||
Data in column predetermined by what has been entered in previous | Excel Discussion (Misc queries) |