Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Combination: DataValidation auto appear + show all rows


Hi there

I use this code to make my Drop down Data validation drops
automatically,
the code :

Code:
--------------------

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
On Error GoTo NoValidation
If Target.Validation.InCellDropdown Then
Application.SendKeys "%{Up}"

NoValidation:
Err.Clear
End If

End Sub
--------------------


In addtion to this i use another code to make the drop down data
validation show all the visible list rows of the Data Validation list.

the code :

Code:
--------------------
Dim oDpd As Object
Dim sFml1
Dim prvTarget As Range

Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
Const dFixedPos As Double = "0.8"
Const dFixWidth As Double = "12.0" 'Change here to change WIDTH of the DropDown
Dim vld As Validation
Dim lDpdLine As Long

If Not prvTarget Is Nothing Then
If Not oDpd Is Nothing Then
If oDpd.Value = 0 Then
' prvTarget.Value = vbNullString
Else
prvTarget.Value = Range(Mid(sFml1, 2)).Item(oDpd.Value)
End If
Set prvTarget = Nothing
End If
End If

On Error Resume Next
oDpd.Delete
sFml1 = vbNullString
Set oDpd = Nothing
On Error GoTo 0

If Target.Count 1 Then
Set oDpd = Nothing
Exit Sub
End If

Set vld = Target.Validation
On Error GoTo Terminate
sFml1 = vld.Formula1
On Error GoTo 0

Set prvTarget = Target

lDpdLine = Range(Mid(sFml1, 2)).Rows.Count

With Target
Set oDpd = ActiveSheet.DropDowns.Add( _
.Left - dFixedPos, _
.Top - dFixedPos, _
.Width + dFixWidth + dFixedPos * 2, _
.Height + dFixedPos * 2)
End With
With oDpd
.ListFillRange = sFml1
.DropDownLines = lDpdLine
.Display3DShading = True

End With
Terminate:

End Sub
--------------------


*The Need:
I tried to combine both codes to make my drop down data validation
appears automatically and shows all the visible list rows of the Data
Validation list ?

but without success.................couold you pls help in the case*


--
helmekki


------------------------------------------------------------------------
helmekki's Profile: http://www.excelforum.com/member.php...fo&userid=6939
View this thread: http://www.excelforum.com/showthread...hreadid=378289

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Combination: DataValidation auto appear + show all rows


any idea ?


--
helmekki


------------------------------------------------------------------------
helmekki's Profile: http://www.excelforum.com/member.php...fo&userid=6939
View this thread: http://www.excelforum.com/showthread...hreadid=378289

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Combination: DataValidation auto appear + show all rows


???..........


--
helmekki


------------------------------------------------------------------------
helmekki's Profile: http://www.excelforum.com/member.php...fo&userid=6939
View this thread: http://www.excelforum.com/showthread...hreadid=378289

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
create 1 master list from a combination of rows and columns Jason Excel Discussion (Misc queries) 3 August 17th 09 06:24 PM
selecting data from a combination of columns & rows. Browny Excel Discussion (Misc queries) 5 July 30th 09 09:47 AM
Auto show data but without using Auto Filter LP Excel Discussion (Misc queries) 1 April 8th 09 12:06 AM
Why don't all my data rows show up in auto-filter? anromath Excel Worksheet Functions 7 April 16th 07 05:46 PM
How to show all the possible combination of a set of numbers? [email protected] Excel Worksheet Functions 3 February 12th 06 10:29 AM


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