View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Greg Snidow Greg Snidow is offline
external usenet poster
 
Posts: 153
Default Validation list problem

Well, I was in a pinch, so I solved my problem by inserting code in the macro
to move the lists back to their original position after every insert. I
would still like to know how to programatically set the list reference.
Thanks

Sub MoveLists()

Dim TopRow As String
Dim LstRow As String

LstRow = [F65000].End(xlUp).Row
Range("F" & LstRow).Activate
Do While ActiveCell.Value < ""
If ActiveCell.Value < "" Then
ActiveCell.Offset(-1, 0).Activate
End If
Loop

TopRow = ActiveCell.Offset(1, 0).Row

Rows(TopRow & ":" & LstRow).Cut
Rows("200").Select
Selection.Insert shift:=xlDown

End Sub

"Greg Snidow" wrote:

Greetings all. I have a workbook with a sheet for each month of the year,
and a blank template at the end to add new months. In some of the columns,
the cells are populated by using a pick list which I created using
DataValidation, and typing the values way below the records. No problems
here. The problem is that if I have to cut and insert a row from one sheet
to the next, the list references in the cut row are off. I tried creating a
sheet called 'Data', and make the list reference 'Data!$A2:A...', but the
error says that I must use a list on the same page. Is there a way for me to
reference a list on another sheet? Or, how could I use VB to programatically
set the list to the range of the list on the new sheet?