View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Vergel Adriano Vergel Adriano is offline
external usenet poster
 
Posts: 857
Default centering checkboxes vertical in cell

wsh is not defined. Try replacing wsh with ActiveSheet.

--
Hope that helps.

Vergel Adriano


"ranswert" wrote:

I used this code to center a checkbox vertically in a cell and I got a "run
time error object required message". This is the code I entered:

Sub cbox()
Dim cell As Range
Dim chk As Excel.CheckBox
Set cell = ActiveCell
Set chk = wsh.CheckBoxes.Add(cell.Left + 0.3 * cell.Width, cell.Top,
cell.Width, cell.Height)
chk.Height = cell.Height - 1.5

End Sub