View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Checkbox question

or maybe:


Option Explicit
Private Sub UserForm_Initialize()
dim rng as range
Set rng = activesheet.Cells(ActiveCell.Row, 1)
Me.CheckBox1.Value = CBool(rng(1,2).Value < "")
End Sub



Patrick Simonds wrote:

I should mention that I use the following to define rng:

Dim rng
Set rng = Cells(ActiveCell.Row, 1)

"Patrick Simonds" wrote in message
...
I can not reference a set cell, it will always go to the same column, but
the row will be determined by which row the curser is on. That is why I
was trying the rng(1, 2). For this Checkbox it will always look at column
2 of the current row.



"Dave Peterson" wrote in message
...
Maybe something like:

Option Explicit
Private Sub UserForm_Initialize()
Me.CheckBox1.Value = CBool(Worksheets("sheet1").Range("a1").Value <
"")
End Sub



Patrick Simonds wrote:

On my userform initialize code, I want to have the checkbox value to be
true
(checked) if there is something in the referenced cell. I populate my
textboxes with:

TextBox5.Text = rng(1, 2).Value

but not sure how to do this with a checkbox.

--

Dave Peterson




--

Dave Peterson