LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 71
Default UserForm Issues

Hello - I am new to programming in VB - I am using Excel 2003. I am mostly
reading some Excel help books and Searching on the internet for example code.

Characteristics of userform:
- I have a UserForm that displays properly when excuting the Macro in the
Workbook (which only has 1 worksheet)
- I have only 2 Option Buttons set in a Frame -- the values CAN be selected
(one at a time) -- Option Button Names: OpBtnIVA, OpBtnIVAExento
- I have an OK button - which is NOT working properly - I get an error of
"1004" when clicked -- Button Name: ButtonOK
- I also have code for the UserForm Cancel Control - which IS working
properly.

Results Expected:
1. When selecting OpBtnIVA then Cell D41 will be populated with D39*0.16
(computed value)
Note: D41 is a combined range of cells (D41, D42, E41 and E42) but when
selecting the range (in Excel) the cell is listed as D41.
2. When selecting OpBtnIVAExento then Cell D41 will be populated with the
text EXENTO
Note: D39 is a combined range of cells (D39, D40, E39 and E40) but when
selecting the range (in Excel) the cell is listed as D39

I have tried the following 2 codes in my button but either code is not
functioning.

1st Button Code:

Private Sub ButtonOK_Click()

Dim x As Control

For Each x In Frame1.Controls
If x.Value = "OpBtnIVA" Then
Range(D41).Value = Range("D39") * 0.16
Unload FormIVA

ElseIf x.Value = "OpBtnIVAExento" Then
Range(D41).Value = "EXENTO"
Unload FormIVA

End If
Next

End Sub


2nd Button Code:

Private Sub ButtonOK_Click()

If OpBtnIVA Then Cells(41, D).Value = Cells(39, D).Value * 0.16
If OpBtnIVAExento Then Cells(41, D).Value = "EXENTO"
Unload FormIVA

End Sub

If you need anything else, please indicate. All help is greatly appreciated.

thank you in advance
Maria
 
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
Issues with UserForm Box [email protected] Excel Programming 5 May 19th 09 09:58 PM
Font Issues when using UserForm box after clicking a Checkbox RobGolf72 Excel Discussion (Misc queries) 1 October 9th 07 07:51 PM
Userform/Textbox Issues mastermind Excel Programming 2 May 21st 07 03:46 AM
Userform/TextBox Issues mastermind Excel Programming 1 May 20th 07 12:48 PM
Excel UserForm issues: Textboxes cannot be blank [email protected] Excel Programming 1 January 8th 07 09:05 AM


All times are GMT +1. The time now is 04:43 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"