Student1000
Board Regular
- Joined
- Jul 17, 2007
- Messages
- 58
Well, couple of days ago someone responded to the question i had on how to increase the font size of a data validation(dropdownbox) and he gave me the code below. This code was to eliminate double clicking on a cell to increase its font.
I created a combo box and add the code in visual basic. However, it does not seem to work. I dont know if i need to do something else or doing something wrong.
Am still working on it, so if there is any body that can help me out i would appriciate it alot.
thank you
EDIT: added code tags - Moderator
I created a combo box and add the code in visual basic. However, it does not seem to work. I dont know if i need to do something else or doing something wrong.
Am still working on it, so if there is any body that can help me out i would appriciate it alot.
thank you
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim str As String
Dim cboTemp As OLEObject
Dim ws As Worksheet
Set ws = ActiveSheet
If Target.Validation.Type = xlValidateList Then
Set ws = ActiveSheet
Cancel = True
Set cboTemp = ws.OLEObjects("TempCombo")
On Error Resume Next
With cboTemp
.ListFillRange = ""
.LinkedCell = ""
.Visible = False
End With
On Error GoTo errHandler
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 + 15
.Height = Target.Height + 5
.ListFillRange = ws.Range(str).Address
.LinkedCell = Target.Address
End With
cboTemp.Activate
End If
errHandler:
Application.EnableEvents = True
Exit Sub
End Sub
EDIT: added code tags - Moderator