Help VBA command

Halos

New Member
Joined
Feb 14, 2015
Messages
34
Dear All,

I have created new USERFORM1 and added comboBox which there multiple selection types. Please see below code:

Code:
Private Sub ComboBox1_Change()
With ComboBox1
        
    End With
End Sub

Code:
Private Sub CommandButton1_Click()
If ComboBox1 = vbNullString Or TextBox1 = vbNullString Or TextBox2 = vbNullString Or TextBox4 = vbNullString Then
MsgBox "Butun xanalar doldurulmalidir"
Else
      
      Sheets("hesab" + ComboBox1.Value).Rows(6).Insert
      
      Sheets("hesab" + ComboBox1.Value).Range("C6") = TextBox1
      Sheets("hesab" + ComboBox1.Value).Range("D6").Value = TextBox2.Value

When I select one of the selection type from the box, this copy to the sheet name "hesab".

The problem is I cannot create new comboBox2 and put command to affect same sheet which name is "hesab" but copy info another column. For example, I select one of the type "book" and this automatically copied to the sheet which named "hesab". But I want to create new comboBox (which already created) and want to lync to the same sheet named "hesab" and copy to the other range.

Thanks

Khalid
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.

Forum statistics

Threads
1,224,824
Messages
6,181,186
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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