#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default Checkboxes

Greetings! Why am I getting the "Object doesn't support this property or
method" error on the following code:

For Each ctrl In Me.Controls
If TypeOf ctrl Is MSForms.CheckBox Then
n = n + 1
If ctrl.Value Then
.Offset(0, n).Value = Chr(82) <------Error
End If
End If
Next ctrl

TIA

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Checkboxes

because you don't have a With statement with a valid object identified that
has an Offset property.

Perhaps

With ActiveCell
For Each ctrl In Me.Controls
If TypeOf ctrl Is MSForms.CheckBox Then
n = n + 1
If ctrl.Value Then
.Offset(0, n).Value = Chr(82)
End If
End If
Next ctrl
End With



--
Regards,
Tom Ogilvy

"Robbyn" wrote:

Greetings! Why am I getting the "Object doesn't support this property or
method" error on the following code:

For Each ctrl In Me.Controls
If TypeOf ctrl Is MSForms.CheckBox Then
n = n + 1
If ctrl.Value Then
.Offset(0, n).Value = Chr(82) <------Error
End If
End If
Next ctrl

TIA

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default Checkboxes

Hi Tom. I had with statement but I found a silly error. Your example helped
me find it. Thank you much.

"Tom Ogilvy" wrote:

because you don't have a With statement with a valid object identified that
has an Offset property.

Perhaps

With ActiveCell
For Each ctrl In Me.Controls
If TypeOf ctrl Is MSForms.CheckBox Then
n = n + 1
If ctrl.Value Then
.Offset(0, n).Value = Chr(82)
End If
End If
Next ctrl
End With



--
Regards,
Tom Ogilvy

"Robbyn" wrote:

Greetings! Why am I getting the "Object doesn't support this property or
method" error on the following code:

For Each ctrl In Me.Controls
If TypeOf ctrl Is MSForms.CheckBox Then
n = n + 1
If ctrl.Value Then
.Offset(0, n).Value = Chr(82) <------Error
End If
End If
Next ctrl

TIA

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Checkboxes Elaine Excel Discussion (Misc queries) 6 August 20th 09 01:41 AM
Using Checkboxes ppidgursky Excel Discussion (Misc queries) 0 April 7th 09 07:24 PM
checkboxes helpless101 Excel Worksheet Functions 0 April 10th 06 11:54 AM
Help with checkboxes asmenut Excel Programming 0 August 20th 04 07:16 PM
Checkboxes Thornsberry Excel Programming 1 November 11th 03 03:01 AM


All times are GMT +1. The time now is 01:24 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"