Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 236
Default Validation; add items to named range

I HAD A TYPO THE
i typed this (0,1) but had to be this (1,0)

This is how the code figures where to put the new value
the code:
Worksheets("Params").Cells(Rows.Count, 3).End(xlUp).Offset _
(1, 0).Value = NewEntry

the explanation:

Worksheets("Params").Cells(Rows.Count, 3) = this would be the last
cell in column 3 (C - that's where your list is). If you're 2003, then
it would be cell C65355K

..End(xlUp) = this bit would result into the last nonblank (i use the
term loosely here) in the same column C
..Offset(1,0) = this bit gets it to the cell one row below the last
nonblank row and puts the new value in it.

Then, the offset formula in Name defintion just adds it to the list.


On 17 July, 22:53, AB wrote:
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


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Named Range name problem in validation TimD Excel Worksheet Functions 3 January 16th 07 07:09 PM
Data validation drop downs don't recognize dynamic named range GlenC Excel Discussion (Misc queries) 0 July 19th 06 06:25 PM
Using a data validation list to look up a defined named range in another worksheet Laura Hunt Charts and Charting in Excel 0 November 24th 05 02:29 PM
Data validation named range update Phil Deem Excel Discussion (Misc queries) 3 July 16th 05 03:55 AM
named range, data validation: list non-selected items, and new added items KR Excel Discussion (Misc queries) 1 June 24th 05 05:21 AM


All times are GMT +1. The time now is 01:53 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"