Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 121
Default Dynamic Range

Using MSOffice 2003

I have a ws named lists. Col A has my list that I am using in the data
validation technique to get drop boxes on my working spreadsheet. It is
working well as is, but I want the user to be able to add to the list.

When I add an item thru the drop box, it does not get added to the
column in the Lists ws.

I do have error alert unchecked in the data validation dialog box.

Here is my syntax for making the list dynamic - I suspect something is
incorrect here, but don't know what it is.

=OFFSET(Lists!$A$1,0,0,COUNTA(Lists!$A:$A),1)

Thanks for your time
Joanne

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,979
Default Dynamic Range

You can use programming to add new items to the list. There's a sample
file he

http://www.contextures.com/excelfiles.html

Under Data Validation, look for 'DV0012 - Update Validation List'

Joanne wrote:
Using MSOffice 2003

I have a ws named lists. Col A has my list that I am using in the data
validation technique to get drop boxes on my working spreadsheet. It is
working well as is, but I want the user to be able to add to the list.

When I add an item thru the drop box, it does not get added to the
column in the Lists ws.

I do have error alert unchecked in the data validation dialog box.

Here is my syntax for making the list dynamic - I suspect something is
incorrect here, but don't know what it is.

=OFFSET(Lists!$A$1,0,0,COUNTA(Lists!$A:$A),1)

Thanks for your time
Joanne



--
Debra Dalgleish
Contextures
http://www.contextures.com/tiptech.html

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 121
Default Dynamic Range

Debra Dalgleish wrote:
I lifted the code right out of sample spreadsheet in DV0012 and pasted
it into my worksheet.
I changed Target.column to 1 instead of 3 because my data is in col A
I changed "NameList" to "JobDescription" where necessary because that is
the name of my range.
'Lists' is the name of my ws with my list on it so I left that alone.
Still, it will not add any new data to the list.
What am I missing here please?

Private Sub Worksheet_Change(ByVal Target As Range)
On Error Resume Next
Dim ws As Worksheet
Dim i As Integer

Set ws = Worksheets("Lists")
If Target.Column = 1 And Target.Row 1 Then
If Application.WorksheetFunction.CountIf(ws.Range("Jo bDescription"),
Target.Value) Then
Exit Sub
Else
i = ws.Cells(Rows.Count, 1).End(xlUp).Row + 1
ws.Range("A" & i).Value = Target.Value
ws.Range("JobDescription").Sort Key1:=ws.Range("A1"), _
Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, _
Orientation:=xlTopToBottom
End If
End If

End Sub

Thanks for your help - it is much appreciated
Joanne

You can use programming to add new items to the list. There's a sample
file he

http://www.contextures.com/excelfiles.html

Under Data Validation, look for 'DV0012 - Update Validation List'

Joanne wrote:
Using MSOffice 2003

I have a ws named lists. Col A has my list that I am using in the data
validation technique to get drop boxes on my working spreadsheet. It is
working well as is, but I want the user to be able to add to the list.

When I add an item thru the drop box, it does not get added to the
column in the Lists ws.

I do have error alert unchecked in the data validation dialog box.

Here is my syntax for making the list dynamic - I suspect something is
incorrect here, but don't know what it is.

=OFFSET(Lists!$A$1,0,0,COUNTA(Lists!$A:$A),1)

Thanks for your time
Joanne





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,979
Default Dynamic Range

Did you paste the code into the worksheet module for the sheet with the
data?
Are macros enabled in the workbook?

Joanne wrote:
Debra Dalgleish wrote:
I lifted the code right out of sample spreadsheet in DV0012 and pasted
it into my worksheet.
I changed Target.column to 1 instead of 3 because my data is in col A
I changed "NameList" to "JobDescription" where necessary because that is
the name of my range.
'Lists' is the name of my ws with my list on it so I left that alone.
Still, it will not add any new data to the list.
What am I missing here please?

Private Sub Worksheet_Change(ByVal Target As Range)
On Error Resume Next
Dim ws As Worksheet
Dim i As Integer

Set ws = Worksheets("Lists")
If Target.Column = 1 And Target.Row 1 Then
If Application.WorksheetFunction.CountIf(ws.Range("Jo bDescription"),
Target.Value) Then
Exit Sub
Else
i = ws.Cells(Rows.Count, 1).End(xlUp).Row + 1
ws.Range("A" & i).Value = Target.Value
ws.Range("JobDescription").Sort Key1:=ws.Range("A1"), _
Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, _
Orientation:=xlTopToBottom
End If
End If

End Sub

Thanks for your help - it is much appreciated
Joanne


You can use programming to add new items to the list. There's a sample
file he

http://www.contextures.com/excelfiles.html

Under Data Validation, look for 'DV0012 - Update Validation List'

Joanne wrote:

Using MSOffice 2003

I have a ws named lists. Col A has my list that I am using in the data
validation technique to get drop boxes on my working spreadsheet. It is
working well as is, but I want the user to be able to add to the list.

When I add an item thru the drop box, it does not get added to the
column in the Lists ws.

I do have error alert unchecked in the data validation dialog box.

Here is my syntax for making the list dynamic - I suspect something is
incorrect here, but don't know what it is.

=OFFSET(Lists!$A$1,0,0,COUNTA(Lists!$A:$A),1)

Thanks for your time
Joanne







--
Debra Dalgleish
Contextures
http://www.contextures.com/tiptech.html

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 121
Default Dynamic Range

Debra Dalgleish wrote:
Yes, the code is pasted in the worksheet 'invoices' which is where I am
using the data validation drop list technique. It is using the 'change'
declaration of the worksheet.
The sort for sending empty entries to the end of the list is pasted on
the 'lists' worksheet using 'SelectionChange' as declaration.

Should I have pasted these sub routines in the workbook instead of on
the individual sheets, or should I maybe have declared a new module and
put them in there?

Thanks for your help Debra
Joanne
Did you paste the code into the worksheet module for the sheet with the
data?
Are macros enabled in the workbook?

Joanne wrote:
Debra Dalgleish wrote:
I lifted the code right out of sample spreadsheet in DV0012 and pasted
it into my worksheet.
I changed Target.column to 1 instead of 3 because my data is in col A
I changed "NameList" to "JobDescription" where necessary because that is
the name of my range.
'Lists' is the name of my ws with my list on it so I left that alone.
Still, it will not add any new data to the list.
What am I missing here please?

Private Sub Worksheet_Change(ByVal Target As Range)
On Error Resume Next
Dim ws As Worksheet
Dim i As Integer

Set ws = Worksheets("Lists")
If Target.Column = 1 And Target.Row 1 Then
If Application.WorksheetFunction.CountIf(ws.Range("Jo bDescription"),
Target.Value) Then
Exit Sub
Else
i = ws.Cells(Rows.Count, 1).End(xlUp).Row + 1
ws.Range("A" & i).Value = Target.Value
ws.Range("JobDescription").Sort Key1:=ws.Range("A1"), _
Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, _
Orientation:=xlTopToBottom
End If
End If

End Sub

Thanks for your help - it is much appreciated
Joanne


You can use programming to add new items to the list. There's a sample
file he

http://www.contextures.com/excelfiles.html

Under Data Validation, look for 'DV0012 - Update Validation List'

Joanne wrote:

Using MSOffice 2003

I have a ws named lists. Col A has my list that I am using in the data
validation technique to get drop boxes on my working spreadsheet. It is
working well as is, but I want the user to be able to add to the list.

When I add an item thru the drop box, it does not get added to the
column in the Lists ws.

I do have error alert unchecked in the data validation dialog box.

Here is my syntax for making the list dynamic - I suspect something is
incorrect here, but don't know what it is.

=OFFSET(Lists!$A$1,0,0,COUNTA(Lists!$A:$A),1)

Thanks for your time
Joanne











  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,979
Default Dynamic Range

The Change event code should be on the Invoices sheet, and it includes a
sort after the new item is added to the list. You shouldn't need a
separate procedure on the Lists sheet to sort the items.

Does the sample workbook work correctly when you try it?

Joanne wrote:
Debra Dalgleish wrote:
Yes, the code is pasted in the worksheet 'invoices' which is where I am
using the data validation drop list technique. It is using the 'change'
declaration of the worksheet.
The sort for sending empty entries to the end of the list is pasted on
the 'lists' worksheet using 'SelectionChange' as declaration.

Should I have pasted these sub routines in the workbook instead of on
the individual sheets, or should I maybe have declared a new module and
put them in there?

Thanks for your help Debra
Joanne

Did you paste the code into the worksheet module for the sheet with the
data?
Are macros enabled in the workbook?

Joanne wrote:

Debra Dalgleish wrote:
I lifted the code right out of sample spreadsheet in DV0012 and pasted
it into my worksheet.
I changed Target.column to 1 instead of 3 because my data is in col A
I changed "NameList" to "JobDescription" where necessary because that is
the name of my range.
'Lists' is the name of my ws with my list on it so I left that alone.
Still, it will not add any new data to the list.
What am I missing here please?

Private Sub Worksheet_Change(ByVal Target As Range)
On Error Resume Next
Dim ws As Worksheet
Dim i As Integer

Set ws = Worksheets("Lists")
If Target.Column = 1 And Target.Row 1 Then
If Application.WorksheetFunction.CountIf(ws.Range("Jo bDescription"),
Target.Value) Then
Exit Sub
Else
i = ws.Cells(Rows.Count, 1).End(xlUp).Row + 1
ws.Range("A" & i).Value = Target.Value
ws.Range("JobDescription").Sort Key1:=ws.Range("A1"), _
Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, _
Orientation:=xlTopToBottom
End If
End If

End Sub

Thanks for your help - it is much appreciated
Joanne



You can use programming to add new items to the list. There's a sample
file he

http://www.contextures.com/excelfiles.html

Under Data Validation, look for 'DV0012 - Update Validation List'

Joanne wrote:


Using MSOffice 2003

I have a ws named lists. Col A has my list that I am using in the data
validation technique to get drop boxes on my working spreadsheet. It is
working well as is, but I want the user to be able to add to the list.

When I add an item thru the drop box, it does not get added to the
column in the Lists ws.

I do have error alert unchecked in the data validation dialog box.

Here is my syntax for making the list dynamic - I suspect something is
incorrect here, but don't know what it is.

=OFFSET(Lists!$A$1,0,0,COUNTA(Lists!$A:$A), 1)

Thanks for your time
Joanne


--
Debra Dalgleish
Contextures
http://www.contextures.com/tiptech.html

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
dynamic range based on criteria, within a dynamic range, passed to a function [email protected] Excel Programming 5 October 9th 07 10:13 PM
creating a dynamic range based on criteria, within a dynamic range, and passing it to a function [email protected] Excel Programming 0 October 9th 07 05:22 PM
Dynamic Range with unused formula messing up x axis on dynamic graph [email protected] Charts and Charting in Excel 2 February 2nd 06 08:02 PM
copying dynamic range based on cell outside of range xcelelder Excel Programming 3 September 29th 05 05:08 PM
select dynamic range with dynamic start point Juli Excel Programming 1 August 31st 05 12:05 AM


All times are GMT +1. The time now is 06:45 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"