View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips Bob Phillips is offline
external usenet poster
 
Posts: 10,593
Default Updating a validation list macro

Try this

Cells(Cells(Rows.Count, "F").End(xlUp).Row + 1, "F").Value =
InputBox("Enter Name")


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"rammieib" wrote in message
ups.com...
Bob

Entering a text value, it would be the name of someone new joining the
company for instance. I want that name putting into the range F2:F34
which is the list of current names. This is my DV list.

Range("f2") = InputBox("Enter name")

That line does not put whatever name entered into cell F2 when you
click ok. Why? This was the code I next tried after yours.

Thanks




Bob Phillips wrote:
Is it a text value you are entering, or a number? Also, is your original
list in the DV, or referencing a range somewhere?

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"rammieib" wrote in message
oups.com...
Bob

Thanks for your reply. I have been unable to make it work. After
entering the name into the inputbox, I cannot get that name to appear
in the cell when I push the validation list down one. I have the
following:

Sub EnterNewBuyer()

Dim ans
ans = InputBox("New value")
Range("FR2").Select
Selection.Insert Shift:=xlDown
With ActiveCell
ans = .Validation.Formula1 & "," & ans
.Validation.Delete
.Validation.Add Type:=xlValidateList, Formula1:=ans


Range("FR2:FR34").Select
Selection.Sort Key1:=Range("FR2"), Order1:=xlAscending,
Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom,

_
DataOption1:=xlSortNormal

Range("B5").Select

End With
End Sub