View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
michael.beckinsale michael.beckinsale is offline
external usenet poster
 
Posts: 274
Default combobox rowsource = named range ??

Hi All,

I am sure this is quite simple but l have got my 'friday its the end
of the week' head on and can't fathom it out!

Can anybody tell me why the following code is not working & how to
correct it. The form is in my 'personal.xls' file and the ranges
referred to are in the 'personal.xls' file. When l launch the form
with the 'personal.xls' window active the form populates correctly but
whenever a different window is active the form will not populate
correctly.

Private Sub UserForm_Initialize()

Dim MySheet As Worksheet
Set MySheet = ThisWorkbook.Sheets("MyFormats")
cbFontName.RowSource = MySheet.Range("MyFontName").Address
cbFontSize.RowSource = MySheet.Range("FontSize").Address
cbRowHeight.RowSource = MySheet.Range("RowHeight").Address
cbDecimal.RowSource = MySheet.Range("Decimal").Address
cbNegative.RowSource = MySheet.Range("NegativeDisplay").Address

End Sub

All help greatly appreciated

Regards

Michael