ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Object error on an Option Button (https://www.excelbanter.com/excel-programming/312173-object-error-option-button.html)

Garry[_7_]

Object error on an Option Button
 
Hello

I have a userform with a multipage control with textboxes and a frame
containing an optionbox. The code for the option box is

If frmAddPayments.OptionButton1.Value = True Then
Sheets("payments").txtTax.Value = "Includes"
ElseIf frmAddPayments.OptionButton2.Value = True Then
txtTax.Value = "Excludes"
Else
txtTax.Value = "Non Taxable"
End If
What I am trying to do is to fill a cell with include exclude or Non
Taxable.
I use the DIM txtTax, txtType to declare the variables in the form
initialise statement.

I get the error object required. How do i refer to this and am I doing
it right?
garry

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Bob Phillips[_6_]

Object error on an Option Button
 
Is txtTav a textbox on the worksheet or are you trying to get at the textbox
on the form? If the latter, not uses a Sheets qualifier, use Me.

--

HTH

RP

"Garry" wrote in message
...
Hello

I have a userform with a multipage control with textboxes and a frame
containing an optionbox. The code for the option box is

If frmAddPayments.OptionButton1.Value = True Then
Sheets("payments").txtTax.Value = "Includes"
ElseIf frmAddPayments.OptionButton2.Value = True Then
txtTax.Value = "Excludes"
Else
txtTax.Value = "Non Taxable"
End If
What I am trying to do is to fill a cell with include exclude or Non
Taxable.
I use the DIM txtTax, txtType to declare the variables in the form
initialise statement.

I get the error object required. How do i refer to this and am I doing
it right?
garry

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!




Garry[_7_]

Object error on an Option Button
 
The txtTax is supposed to be a variable that I can use to set a cell to
a value. ie x=5 or x=true then put that into a cell.

I am new to this so don't assume anything and you can be as blunt as you
like as long as I get this working <g.

tx

garry

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


All times are GMT +1. The time now is 06:16 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com