Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Data Validation and List Length


I'm trying to make a combo box that allows me to display more than
rows of data in the drop down list. I copied/pasted macro from sampl
file listed at www.contextures.on.ca/excelfiles.html#DataVal, but
can't get combo box to "behave" properly in my spreadsheet. I name
the combo box "TempCombo" to match the macro name. When I double clic
on the cell containing my datavalidation list, the macro initiates th
combo box, but the box doesn't insert the "LinkedCell" an
"ListFillRange" like it's supposed to. Anyone try to use this before
Thanks

--
Tom Kolkmeie
-----------------------------------------------------------------------
Tom Kolkmeier's Profile: http://www.excelforum.com/member.php...fo&userid=1546
View this thread: http://www.excelforum.com/showthread.php?threadid=27050

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,979
Default Data Validation and List Length

The sample workbook uses a list on the same worksheet. If you're using a
named range on a different sheet, you could add a reference to that
sheet. For example:

'===========================
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
Dim str As String
Dim cboTemp As OLEObject
Dim ws As Worksheet
Dim wsList As Worksheet
Set ws = ActiveSheet
Set wsList = Sheets("Sheet2")
Cancel = True
Set cboTemp = ws.OLEObjects("TempCombo")
On Error Resume Next
With cboTemp
.ListFillRange = ""
.LinkedCell = ""
.Visible = False
End With
On Error GoTo errHandler
If Target.Validation.Type = 3 Then
Application.EnableEvents = False
str = Target.Validation.Formula1
str = Right(str, Len(str) - 1)
With cboTemp
.Visible = True
.Left = Target.Left
.Top = Target.Top
.Width = Target.Width + 5
.Height = Target.Height + 5
.ListFillRange = wsList.Range(str).Name
.LinkedCell = Target.Address
End With
cboTemp.Activate
End If

errHandler:
Application.EnableEvents = True
Exit Sub

End Sub
'===========================

Tom Kolkmeier wrote:
I'm trying to make a combo box that allows me to display more than 8
rows of data in the drop down list. I copied/pasted macro from sample
file listed at www.contextures.on.ca/excelfiles.html#DataVal, but I
can't get combo box to "behave" properly in my spreadsheet. I named
the combo box "TempCombo" to match the macro name. When I double click
on the cell containing my datavalidation list, the macro initiates the
combo box, but the box doesn't insert the "LinkedCell" and
"ListFillRange" like it's supposed to. Anyone try to use this before?
Thanks!




--
Debra Dalgleish
Excel FAQ, Tips & Book List
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
Data Validation "List" - Setting length of list shown Dave Excel Discussion (Misc queries) 3 January 31st 08 06:51 PM
Data Validation List Length Alex Mackenzie Excel Worksheet Functions 4 November 1st 05 01:27 AM
Validation (Drop down list vs simple text length validation) Bob Phillips[_6_] Excel Programming 2 April 27th 04 07:47 PM
Validation (Drop down list vs simple text length validation) Jason Morin[_2_] Excel Programming 1 April 27th 04 04:56 PM
Validation (Drop down list vs simple text length validation) Pete McCosh Excel Programming 0 April 27th 04 03:49 PM


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