Combo Box

  • Thread starter Thread starter Aksel Børve
  • Start date Start date
A

Aksel Børve

I try to make a macro that use a combo box (ListFillRange: "B4:B120",
Linked Cell: D2).
And a Command Button. When I select a cell from the ListFillRange with
the Combo Box, example "B6", and write a number in cell "D2". I would
like the value to be transfered to the cell "D6" (Offset method?) when I
push the command Button.
Can it be done?
Thanks
 
Hei Aksel
do not use lincedcell in your combobox (= empty)
and try this.

I use range(e2) to put the selections address

Private Sub ComboBox1_Change()
Dim b As String
With ComboBox1
b = Range(.ListFillRange)(.ListIndex + 1).Address(False, False)
ActiveSheet.Range("E2") = b
End With





'
End Sub

Private Sub CommandButton1_Click()
Dim b As String
b = ActiveSheet.Range("e2").Value
Range(b).Offset(0, 1) = ActiveSheet.Range("D2").Value
End Sub


Regards

Yngve Ha en god dag.
 
An alternate interpretation:

Private Sub Commandbutton1_Click()
Range("D6").Value = Range("D2").Value
End Sub
 
Thanks for your solution yngve, the workbook is finish and working.

Og du har helt rett når det gjelder å takke for hjelpen. normal
folkeskikk, beklager!
Mvh. Aksel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top