hindersaliva
asked on
Excel In-Cell Dropdown is very wide
Suddenly my In-cell dropdowns are wider than they were. Why does this happen?
FYI, the dropdown is populated by VBA from a table in Access. Though I suspect this is not the reason.
Sub GetDataToInCellDropdownLeaverReason()
Dim rsData As ADODB.Recordset
Dim sSQL As String
Call DBConnectionAccess
sSQL = "SELECT LeaverReason FROM tblLeaverReasons ORDER BY LeaverReason"
'run the query
Set rsData = New ADODB.Recordset
rsData.Open sSQL, objConn, adOpenForwardOnly, adLockReadOnly, adCmdText
'rsData.Open sSQL, objConn, adOpenStatic, adLockReadOnly, adCmdText
If Not rsData.EOF Then
Do Until rsData.EOF
strItems = strItems + rsData.Fields.Item("LeaverReason").Value + ", "
rsData.MoveNext
Loop
End If
strItems = Left(strItems, Len(strItems) - 1)
'MsgBox "XXX" + strItems + "XXX"
Call UnprotectSheet
With Range("LeaverReasonInCellDropdown").Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:=strItems
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With
Call DBConnectionClose
Call ProtectSheet
End Sub
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER