View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.misc
AB[_2_] AB[_2_] is offline
external usenet poster
 
Posts: 236
Default Validation; add items to named range

Yes, you need to change that:
Worksheets("Params").Cells(Rows.Count, 1).End(xlUp).Offset _
(3, 3).Value = NewEntry
to
Worksheets("Params").Cells(Rows.Count, 3).End(xlUp).Offset _
(0, 1).Value = NewEntry

I changed the '1' to '3' [Cells(Rows.Count, 3] as it needs to add it
to column 'C' (i.e., 3), i also changed the Offset back to (0,1) as it
needs to stay in the column 3 just one row below the last nonblank
cell.

Does it work now?


On 17 July, 21:24, Ixtreme wrote:
Thansk for your help, I still have a little problem. After I get the
message do you want to add it to the list and if I select Yes, nothing
really happens. What is wrong with my code; did I miss anything? I
don't understand how it knows to what named range it should add the
new value.
I have:

Sheet1 D3 has Validation 'Product'
Params C2 'Product' = columname
Params C3 'Product item 1'
Params C4 'Product item 3'
etc.

I have added the named range 'Product' = =OFFSET(Params!$C$3;0;0;COUNTA
(Params!$C:$C )-1)

I think I have to change this piece: * * Worksheets("Params").Cells
(Rows.Count, 1).End(xlUp).Offset _
* * * * (3, 3).Value = NewEntry