Calculate with values in combobox

tfnduarte

New Member
Joined
Sep 14, 2022
Messages
10
Office Version
  1. 2016
Platform
  1. Windows
HI

A complex thing for me....

I introduce values on textbox 252, 253 , 255, 256 and 267 and put the values on folha4.range(a2:e2) than then click commandbutton8 and have a macro that copies the values from folha 4 and put it on folha5.$a:$e.

1 - How do i configure the textbox 253,255,256 and 257 to have the values in currency.
2 - how do i erase the values that are show in 252, 253 , 255, 256 and 267 when click on commandbutton8 after they are in folha5.

VBA Code:
Private Sub TextBox252_Change()
    Folha4.Range("a2").Value = TextBox252
End Sub

Private Sub TextBox253_Change()
    Folha4.Range("b2").Value = TextBox253
End Sub

Private Sub TextBox255_Change()
   Folha4.Range("c2").Value = TextBox255
End Sub

Private Sub TextBox256_Change()
   Folha4.Range("d2").Value = TextBox256
End Sub

Private Sub TextBox257_Change()
    Folha4.Range("e2").Value = TextBox257
End Sub

Private Sub TextBox258_Change()
   Folha5.Range("h2").Value = TextBox258
End Sub

Private Sub CommandButton8_Click()
   Call grava
End Sub

3 - than combobox1 is showing the values that are stored by the clicking the button8
but only the last values when i open the form not in real time
how can i do that to after clicking button8 update the combobox.

4 - When i press commandbutton 9 and want to put the selection in combobox1 to folha5.range(h2:L2)
that will return the values to textbox262, 261 , 260, 259

VBA Code:
Private Sub ComboBox1_Change()


End Sub

Private Sub CommandButton9_Click()
Me.TextBox262.Text = Folha5.Range("i3").Text
Me.TextBox260.Text = Folha5.Range("j3").Text
Me.TextBox261.Text = Folha5.Range("k3").Text
Me.TextBox259.Text = Folha5.Range("l3").Text
End Sub

Other question
It's possible to put ther form maximizing the window in order to be scrolled in monitors with worse resolution?

Thank you in advance
 

Attachments

  • duvida.png
    duvida.png
    66 KB · Views: 2

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
HI

A complex thing for me....

I introduce values on textbox 252, 253 , 255, 256 and 267 and put the values on folha4.range(a2:e2) than then click commandbutton8 and have a macro that copies the values from folha 4 and put it on folha5.$a:$e.

1 - How do i configure the textbox 253,255,256 and 257 to have the values in currency.
2 - how do i erase the values that are show in 252, 253 , 255, 256 and 267 when click on commandbutton8 after they are in folha5.

VBA Code:
Private Sub TextBox252_Change()
    Folha4.Range("a2").Value = TextBox252
End Sub

Private Sub TextBox253_Change()
    Folha4.Range("b2").Value = TextBox253
End Sub

Private Sub TextBox255_Change()
   Folha4.Range("c2").Value = TextBox255
End Sub

Private Sub TextBox256_Change()
   Folha4.Range("d2").Value = TextBox256
End Sub

Private Sub TextBox257_Change()
    Folha4.Range("e2").Value = TextBox257
End Sub

Private Sub TextBox258_Change()
   Folha5.Range("h2").Value = TextBox258
End Sub

Private Sub CommandButton8_Click()
   Call grava
End Sub

3 - than combobox1 is showing the values that are stored by the clicking the button8
but only the last values when i open the form not in real time
how can i do that to after clicking button8 update the combobox.

4 - When i press commandbutton 9 and want to put the selection in combobox1 to folha5.range(h2:L2)
that will return the values to textbox262, 261 , 260, 259

VBA Code:
Private Sub ComboBox1_Change()


End Sub

Private Sub CommandButton9_Click()
Me.TextBox262.Text = Folha5.Range("i3").Text
Me.TextBox260.Text = Folha5.Range("j3").Text
Me.TextBox261.Text = Folha5.Range("k3").Text
Me.TextBox259.Text = Folha5.Range("l3").Text
End Sub

Other question
It's possible to put ther form maximizing the window in order to be scrolled in monitors with worse resolution?

Thank you in advance
The 4 question is solved

VBA Code:
Private Sub ComboBox1_Change()
   Folha5.Range("I2").Value = ComboBox1.Column(0)
   Folha5.Range("j2").Value = ComboBox1.Column(1)
   Folha5.Range("k2").Value = ComboBox1.Column(2)
   Folha5.Range("l2").Value = ComboBox1.Column(3)
   Folha5.Range("m2").Value = ComboBox1.Column(4)
  
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,923
Messages
6,122,289
Members
449,077
Latest member
Rkmenon

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