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

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.

onlyadrafter

Well-known Member
Joined
Aug 19, 2003
Messages
5,703
Platform
  1. Windows
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
 

SPLUCENA

Board Regular
Joined
Feb 24, 2009
Messages
189
Hi Onlyadrafter,

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


splucena
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,163,875
Messages
5,834,182
Members
430,263
Latest member
abz54

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
Top