# updating dynamic via drop down list

#### dsmdude

##### New Member
http://www.gfcproducts.com/purchase_order_log.xls

I would like to be able to add to my dynamic ranges in the data sheet via the drop down boxes.
If the company is not in the range on my data sheet, i would like to be able to just type in a new one in the drop down box and it will automatically update the data sheet column for company.

I have read alot of other people's efforts on making this work, and I did exactly what was recommended for the other people, and it did not work for me.

If anyone can help out with this, that would be great!

Also, if anyone has any better ideas on how to setup this purchase order log, I would much appreciate it!

### Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a \$25,000 loan, 5% annual interest, 60 month loan.

#### jeffreybrown

##### Well-known Member
Hi dsmdude,

Try this...right click the sheet tab (~ Purchase Order Log ~) and paste this code on the right side of the screen.

Code:
``````Private Sub Worksheet_Change(ByVal Target As Range)
Dim lReply As Long
If Target.Cells.Count > 1 Then Exit Sub
If Target.Column <> 3 Then Exit Sub 'Limits code to column "C"
If IsEmpty(Target) Then Exit Sub
If WorksheetFunction.CountIf(Sheets("Data").Range("company"), Target) = 0 Then
lReply = MsgBox("Add " & Target & " to list", vbYesNo + vbQuestion)
If lReply = vbYes Then
Sheets("Data").Range("company").Cells(Sheets("Data").Range("company").Rows.Count + 1, 1) = Target
End If
End If
End Sub``````

Replies
1
Views
514
Replies
4
Views
467
Replies
5
Views
2K
Replies
8
Views
413
Replies
0
Views
315

1,191,417
Messages
5,986,448
Members
440,030
Latest member
ninomato

### 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?

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