ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Compile Error with User from (https://www.excelbanter.com/excel-programming/367893-compile-error-user.html)

merritts[_9_]

Compile Error with User from
 

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

--
merritt
-----------------------------------------------------------------------
merritts's Profile: http://www.excelforum.com/member.php...fo&userid=3580
View this thread: http://www.excelforum.com/showthread.php?threadid=56351


Leith Ross[_669_]

Compile Error with User from
 

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
and I will gladly look it over for you.

Sincerely,
Leith Ros

--
Leith Ros
-----------------------------------------------------------------------
Leith Ross's Profile:
http://www.excelforum.com/member.php...fo&userid=1846
View this thread: http://www.excelforum.com/showthread.php?threadid=56351


merritts[_10_]

Compile Error with User from
 

Heith,

Thanks! i sent you my workbook.

Andre

--
merritt
-----------------------------------------------------------------------
merritts's Profile: http://www.excelforum.com/member.php...fo&userid=3580
View this thread: http://www.excelforum.com/showthread.php?threadid=56351


Leith Ross[_672_]

Compile Error with User from
 

Hello Andrew,

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

Sincerely,
Leith Ross


--
Leith Ross
------------------------------------------------------------------------
Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465
View this thread: http://www.excelforum.com/showthread...hreadid=563519



All times are GMT +1. The time now is 05:45 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com