Consulting

Results 1 to 2 of 2

Thread: Getting an error - Compile error- User defined type not defined

  1. #1
    VBAX Newbie
    Joined
    Feb 2017
    Posts
    2
    Location

    Getting an error - Compile error- User defined type not defined

    Hi All,

    Please help me in resolving this issue. I have a VBA code after running it i am getting error as below
    Compile error- User defined type not defined. Resolved this issue by Click on Microsoft Scripting runtime but after another error poped up Runtime error 457.

    Sub RunTest2()


    Dim i As Integer
    Dim WsTest2 As Worksheet
    Dim Key As String
    Dim Item As String
    Dim DicoDeal As New Dictionary
    Set WsTest2 = ThisWorkbook.Sheets("TEST 2")

    i = 1
    While WsTest2.Range("A1").Offset(i).Value <> ""
    Key = WsTest2.Range("A1").Offset(i).Value
    Item = WsTest2.Range("C1").Offset(i).Value

    DicoDeal.Add Key, Item

    i = i + 1
    Wend

    End Sub

    Please advise.. Thanks in advance

  2. #2
    VBAX Newbie
    Joined
    Feb 2017
    Posts
    2
    Location
    Please help me on this..

    Quote Originally Posted by Par View Post
    Hi All,

    Please help me in resolving this issue. I have a VBA code after running it i am getting error as below
    Compile error- User defined type not defined. Resolved this issue by Click on Microsoft Scripting runtime but after another error poped up Runtime error 457.

    Sub RunTest2()


    Dim i As Integer
    Dim WsTest2 As Worksheet
    Dim Key As String
    Dim Item As String
    Dim DicoDeal As New Dictionary
    Set WsTest2 = ThisWorkbook.Sheets("TEST 2")

    i = 1
    While WsTest2.Range("A1").Offset(i).Value <> ""
    Key = WsTest2.Range("A1").Offset(i).Value
    Item = WsTest2.Range("C1").Offset(i).Value

    DicoDeal.Add Key, Item

    i = i + 1
    Wend

    End Sub

    Please advise.. Thanks in advance

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •