Iterating the combo box and displaying the value after each change onseprate sheet.

S

sandeep sharma

Here i have a combo box form control, from where i will be picking the value and displaying it on other sheet. Now i am updating the sheet with combo box control, value is getting pasted on Consolidated-Report using:
Worksheets("Consolidated-Report").Range("a9").Value = Me.ComboBox2.Value
If now i again go back to combobox sheet and change the value, same cell is getting updated. I need to move to next row for each time the value is updated in combo box and paste the same on Consolidated-Report sheet.
 
J

Jim Cone

Note: A Combobox from the Control Toolbox has the name ComboBoxN;
a Combobox from the Forms Toolbar has the name Drop Down N.
'---
Private Sub ComboBox1_Change()
Dim LastRow As Long
With Worksheets("Consolidated-Report")
LastRow = .Cells(.Rows.Count, 1).End(xlUp).Row + 1
If LastRow < 9 Then LastRow = 9
.Cells(LastRow, 1).Value = Me.ComboBox2.Value
End With
End Sub
'---
Jim Cone
Portland, Oregon USA .
http://www.mediafire.com/PrimitiveSoftware .
(XL Companion add-in: compares, matches, counts, lists, finds, deletes...)




"sandeep sharma" <[email protected]>
wrote in message
news:[email protected]...
 
J

Jim Cone

Correction: the sub Title should read... Private Sub ComboBox2_Change()

2 not 1
'---
Jim Cone
 

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

Top