Vba question

Giggzz

Well-known Member
Joined
Jul 4, 2002
Messages
990
If r.Value > 0 Then r.Value = r.Value - (r.Value * Len(Right(UserForm6.TextBox1.Value) - 1))

in the above code Im trying to remove the % in the the textbox to get the proper result. Getting the error argument not optional and the right is highlighted.
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
Code:
If r.Value > 0 Then r.Value = r.Value - (r.Value * Right(UserForm6.TextBox1.Value, Len(UserForm6.TextBox1.Value) - 1))
or if this code is in userform6:
Code:
If r.Value > 0 Then r.Value = r.Value - (r.Value * Right(Me.TextBox1.Value, Len(Me.TextBox1.Value) - 1))
 
Upvote 0
Thank you,

Code:
Private Sub totalTextBoxes()
Dim RunningSum As Single
RunningSum = 0
With UserForm6
    Do While .TextBox2.Value = ""
       UserForm6.Show
    Loop
    .TextBox4.Text = Val(.TextBox2.Value) - Val(.TextBox3.Value)
    .[B]TextBox5.Text = Val(.TextBox2.Value) / Val(.TextBox3.Value[/B])
    
End With
End Sub

Trying to add a format in textbox5 to show the percent as 65.27 instead of .672745611??
 
Upvote 0
Code:
.TextBox5.Text = Format(Val(.TextBox2.Value) / Val(.TextBox3.Value), "0%")
 
Upvote 0

Forum statistics

Threads
1,214,805
Messages
6,121,656
Members
449,045
Latest member
Marcus05

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top