Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Les Les is offline
external usenet poster
 
Posts: 240
Default Inserting Drop down on sheet - Array needed

Hi all,

I have sheets that i need to put in a drop down, which i have done with
validation, using the code below.

What i am needing is that i have on sheet "Resposibilities" the drop down
information for it in the range("E2:E" & Lastline). I need to get that into
an array, seperated by a "," for the drop down Formula1.

Any help would be much appreciated.... :-0)


Function InsertDropDown()
'
Dim sAllQMT As String

Columns("P:P").Insert Shift:=xlToRight
Range("P1") = "QMT COMMENTS"
Range("P2").Select
With Selection.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:= _
"T3 - Responsibility,T4 -Responsibility,T5-Responsibility,CKD Part"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With

Selection.Copy
Range("P3:P" & LastRow).Select
Selection.PasteSpecial Paste:=xlPasteValidation, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Range("A1").Select
End Function

--
Les
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Inserting Drop down on sheet - Array needed

So just to be clear you want your validation list to pull it's values from
your Responsibilities sheet with a list that can grow and shrink? Assuming
that to be the case you probably just want to use a dynamic named range.
Validation lists will allow list from ohter sheets so long as they are a
named range and to have the list be expandable a dynamic named range is
ideal... Check out this link...

http://www.cpearson.com/excel/named.htm
--
HTH...

Jim Thomlinson


"Les" wrote:

Hi all,

I have sheets that i need to put in a drop down, which i have done with
validation, using the code below.

What i am needing is that i have on sheet "Resposibilities" the drop down
information for it in the range("E2:E" & Lastline). I need to get that into
an array, seperated by a "," for the drop down Formula1.

Any help would be much appreciated.... :-0)


Function InsertDropDown()
'
Dim sAllQMT As String

Columns("P:P").Insert Shift:=xlToRight
Range("P1") = "QMT COMMENTS"
Range("P2").Select
With Selection.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:= _
"T3 - Responsibility,T4 -Responsibility,T5-Responsibility,CKD Part"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With

Selection.Copy
Range("P3:P" & LastRow).Select
Selection.PasteSpecial Paste:=xlPasteValidation, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Range("A1").Select
End Function

--
Les

  #3   Report Post  
Posted to microsoft.public.excel.programming
Les Les is offline
external usenet poster
 
Posts: 240
Default Inserting Drop down on sheet - Array needed

Thanks Jim
--
Les


"Jim Thomlinson" wrote:

So just to be clear you want your validation list to pull it's values from
your Responsibilities sheet with a list that can grow and shrink? Assuming
that to be the case you probably just want to use a dynamic named range.
Validation lists will allow list from ohter sheets so long as they are a
named range and to have the list be expandable a dynamic named range is
ideal... Check out this link...

http://www.cpearson.com/excel/named.htm
--
HTH...

Jim Thomlinson


"Les" wrote:

Hi all,

I have sheets that i need to put in a drop down, which i have done with
validation, using the code below.

What i am needing is that i have on sheet "Resposibilities" the drop down
information for it in the range("E2:E" & Lastline). I need to get that into
an array, seperated by a "," for the drop down Formula1.

Any help would be much appreciated.... :-0)


Function InsertDropDown()
'
Dim sAllQMT As String

Columns("P:P").Insert Shift:=xlToRight
Range("P1") = "QMT COMMENTS"
Range("P2").Select
With Selection.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:= _
"T3 - Responsibility,T4 -Responsibility,T5-Responsibility,CKD Part"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With

Selection.Copy
Range("P3:P" & LastRow).Select
Selection.PasteSpecial Paste:=xlPasteValidation, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Range("A1").Select
End Function

--
Les

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
Inserting info in a drop down box abumustapha Excel Discussion (Misc queries) 2 May 17th 08 05:51 PM
after inserting a "drop down box" I want the drop arrow to show Snooze Excel Worksheet Functions 1 April 3rd 08 07:46 PM
Inserting Formula into Array [email protected] Excel Discussion (Misc queries) 17 July 2nd 07 06:14 PM
Macro needed for inserting blank rows sunslight Excel Worksheet Functions 2 January 12th 07 05:58 PM
Inserting a row in sheet A should Insert a row in sheet B, removing a row in Sheet A should remove the corresponding row in sheet B Hannes Heckner Excel Programming 1 March 5th 04 09:10 AM


All times are GMT +1. The time now is 08:07 PM.

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

About Us

"It's about Microsoft Excel"