phendrena
01-21-2009, 02:58 AM
Hi there,
I have the following code
Private Sub UserForm_Initialize()
Set ws = Worksheets("Lookups")
Me.StartUpPosition = 0
Me.Top = 125
Me.Left = 125
Me.Width = 365
Me.Height = 396.75
Me.DSTHeader.Width = 365
cboWhoCalled.List = WorksheetFunction.Transpose(ws.Range("WhoCalled"))
cboReason.List = WorksheetFunction.Transpose(ws.Range("CallReason"))
cboSubject.List = WorksheetFunction.Transpose(ws.Range("EmailSubject"))
cboScheme.List = WorksheetFunction.Transpose(ws.Range("Scheme"))
cboSendTo.List = WorksheetFunction.Transpose(ws.Range("Destination"))
Me.txtDate.Value = Format(Date, "yyyy/mm/dd")
Me.txtTime.Value = Time
Me.txtCM.Value = Application.UserName
Me.txtCM.SetFocus
cmdUpdate.Enabled = True
End Sub
This all works fine, however, i now want to set the field cboSendTo to a default value. The value will be taken from the singel cell range named "SupportCM". For the life of me i can't get the field to default to that value.
I've attached the workbook, and there are other references to this field that also change the value. I've tried adding the following into the above
Set des = ws.Range("SupportCM")
cboSendTo.Value = des
and changing the various references to cbSendTo accordingly, but no joy.
Any suggestions?
Thanks,
I have the following code
Private Sub UserForm_Initialize()
Set ws = Worksheets("Lookups")
Me.StartUpPosition = 0
Me.Top = 125
Me.Left = 125
Me.Width = 365
Me.Height = 396.75
Me.DSTHeader.Width = 365
cboWhoCalled.List = WorksheetFunction.Transpose(ws.Range("WhoCalled"))
cboReason.List = WorksheetFunction.Transpose(ws.Range("CallReason"))
cboSubject.List = WorksheetFunction.Transpose(ws.Range("EmailSubject"))
cboScheme.List = WorksheetFunction.Transpose(ws.Range("Scheme"))
cboSendTo.List = WorksheetFunction.Transpose(ws.Range("Destination"))
Me.txtDate.Value = Format(Date, "yyyy/mm/dd")
Me.txtTime.Value = Time
Me.txtCM.Value = Application.UserName
Me.txtCM.SetFocus
cmdUpdate.Enabled = True
End Sub
This all works fine, however, i now want to set the field cboSendTo to a default value. The value will be taken from the singel cell range named "SupportCM". For the life of me i can't get the field to default to that value.
I've attached the workbook, and there are other references to this field that also change the value. I've tried adding the following into the above
Set des = ws.Range("SupportCM")
cboSendTo.Value = des
and changing the various references to cbSendTo accordingly, but no joy.
Any suggestions?
Thanks,