Combobox

SPLUCENA

Board Regular
Joined
Feb 24, 2009
Messages
189
Hi,

My combobox source list is in column A1 of sheet2, on column B1 are other datas directly related to to A1. Is it possible to write a code that if I choose item 1 on column A1, the corresponding data on B1 will copied and pasted to range D10 of sheet1?

Code:
Range("B5").Value = ComboBox1.Value

somethinl like if RANGE("B5")=COMBOBOX1.VALUE THEN
RANGE("D10")=........... I CAN'T FIGURE OUT HOW TO WRITE THE CODE.

thanks,

splucena
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
Hello,

is this it?

Code:
With Sheets("Sheet1")
        .Range("b5").Value = ComboBox1.Value
        .Range("B10").Value = Sheets("Sheet2").Range("A1").Offset(ComboBox1.ListIndex, 1)
    End With
 
Upvote 0
Hi Onlyadrafter,

Still I cannot copy the adjacent cell value with your code.
Thanks anyhow.


splucena
 
Upvote 0

Forum statistics

Threads
1,214,998
Messages
6,122,643
Members
449,093
Latest member
Ahmad123098

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