Compile Error with User from

M

merritts

Hi,

I am using an online tutoria
(http://www.contextures.com/xlUserForm02.html) to create a user for
with combo boxes. Unfortunately the tutorial's actual code lacks th
needed commenting so some of the commands are lost on me. I believe
have modified the code to fit my project, however, after i attempt t
run the user form i get the error "method or data member not found" an
the compiler points me to the "offset" function specifically. Since i a
not quite sure what the function does, i am not sure how to troubleshoo
it. Any help or suggestions would be greatly appreciated.

Below is my code in its entirety.

Private Sub UserForm_Initialize()
Dim cPartType As Range
Dim cLoc As Range
Dim cPartClass As Range
Dim cWhouse As Range
Dim ws As Worksheet
Set ws = Worksheets("LookUpLists")

For Each cPartType In ws.Range("PartTypeList")
With Me.cboPartType
.AddItem cPartType.Value
.List(.ListCount - 1, 1) = cPart.*Offset*(0, 1).Value
End With
Next cPartType

For Each cLoc In ws.Range("LocationList")
With Me.cboLocation
.AddItem cLoc.Value
.List(.ListCount - 1, 1) = cLoc.*Offset*(0, 1).Value
End With
Next cLoc

For Each cPartClass In ws.Range("PartClassList")
With Me.cboPartClass
.AddItem cPartClass.Value
.List(.ListCount - 1, 1) = PartClass.*Offset*(0, 1).Value
End With
Next cPartClass

For Each cWhouse In ws.Range("WarehouseList")
With Me.cboWhouse
.AddItem cWhouse.Value
.List(.ListCount - 1, 1) = cWhouse.*Offset*(0, 1).Value
End With
Next cWhouse

For Each cLoc In ws.Range("LocationList")
With Me.cboLocation
.AddItem cLoc.Value
.List(.ListCount - 1, 1) = cLoc.Offset(0, 1).Value
End With
Next cLoc

'Not quite sure what the below does, especially "set focus"
'Me.txtDate.Value = Format(Date, "Medium Date")
'Me.txtQty.Value = 1
'Me.cboPart.SetFocus

End Su
 
L

Leith Ross

Hello Merritts,

It would be faster and easier if you post your workbook. There a man
places where errors could occur in this project, and not knowing you
exact layout complicates the troubleshooting even more. If you want t
e-mail me a copy of your workbook, you can send to me a
(e-mail address removed) and I will gladly look it over for you.

Sincerely,
Leith Ros
 
L

Leith Ross

Hello Andrew,

I sent the corrected workbook. Have a look and let me know if you find
any more problems.

Sincerely,
Leith Ross
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top