ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   how to make dropdown arrow disappear in vba (https://www.excelbanter.com/excel-worksheet-functions/7178-how-make-dropdown-arrow-disappear-vba.html)

mango

how to make dropdown arrow disappear in vba
 
dear all, may i know which part to disappear the dropdown arrow after input
the data in the cell?
thanks alot


Option Base 1

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
If Not Intersect(Target, Columns("E")) Is Nothing Then
Call AddDropDown(Target)
Cancel = True
End If

End Sub



Sub AddDropDown(Target As Range)
Dim ddBox As DropDown
Dim i As Integer
Dim lookuplist As Variant


lookuplist = Array(Sheet1.Cells.Range("a2:a300"))

With Target
Set ddBox = Sheet4.DropDowns.Add(.Left, .Top, .Width, .Height)
End With

With ddBox
For i = LBound(lookuplist) To UBound(lookuplist)
.AddItem lookuplist(i)

Next i
End With
End Sub



mango

dear all,
can anyone give me the advice?
thanks alot


"mango" wrote:

dear all, may i know which part to disappear the dropdown arrow after input
the data in the cell?
thanks alot


Option Base 1

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
If Not Intersect(Target, Columns("E")) Is Nothing Then
Call AddDropDown(Target)
Cancel = True
End If

End Sub



Sub AddDropDown(Target As Range)
Dim ddBox As DropDown
Dim i As Integer
Dim lookuplist As Variant


lookuplist = Array(Sheet1.Cells.Range("a2:a300"))

With Target
Set ddBox = Sheet4.DropDowns.Add(.Left, .Top, .Width, .Height)
End With

With ddBox
For i = LBound(lookuplist) To UBound(lookuplist)
.AddItem lookuplist(i)

Next i
End With
End Sub



Dave Peterson

You've got lots of replies to your original thread.

mango wrote:

dear all,
can anyone give me the advice?
thanks alot

"mango" wrote:

dear all, may i know which part to disappear the dropdown arrow after input
the data in the cell?
thanks alot


Option Base 1

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
If Not Intersect(Target, Columns("E")) Is Nothing Then
Call AddDropDown(Target)
Cancel = True
End If

End Sub



Sub AddDropDown(Target As Range)
Dim ddBox As DropDown
Dim i As Integer
Dim lookuplist As Variant


lookuplist = Array(Sheet1.Cells.Range("a2:a300"))

With Target
Set ddBox = Sheet4.DropDowns.Add(.Left, .Top, .Width, .Height)
End With

With ddBox
For i = LBound(lookuplist) To UBound(lookuplist)
.AddItem lookuplist(i)

Next i
End With
End Sub



--

Dave Peterson


All times are GMT +1. The time now is 09:26 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com