+ Reply to Thread
Results 1 to 9 of 9

Getting compile error sub or function not define

  1. #1
    Forum Contributor
    Join Date
    06-29-2014
    Location
    India
    MS-Off Ver
    2010 Windows 10 64 bits
    Posts
    1,269

    Getting compile error sub or function not define

    Hi friends,
    I’m getting compile error ‘sub or function not define’ in the attached workbook.

    First I enter a register number in g7 LC sheet and then run the macro ‘LCRecord’.
    I want to record the receipt number a8 and date-time b28 lc sheet on the register sheet in front of that particular register number which is entered in g7 lc sheet.

    If it’s a first time then it should record in the column ‘AF’ in front of that particular register number entered in g7 lc sheet.

    If column ‘ag’ is not blank then the second entry should be in column ‘Ag’ in front of that particular register number entered in g7 lc sheet.

    If column ‘ah’ is not blank then the third entry should be in column ‘Ah’ in front of that particular register number entered in g7 lc sheet.

    If column ‘ai’ is not blank then the fourth entry should be in column ‘Ai’ in front of that particular register number entered in g7 lc sheet.

    If column ‘aj’ is not blank then the fifth entry should be in column ‘Aj’ in front of that particular register number entered in g7 lc sheet.


    And so on endlessly as per the requirement.

    In short the first entry should be in column ‘af’.
    If there is a entry in column ‘af’ then the entries should be as:
    Second on column ag
    Third on column ah
    Fourth on column ai
    Fifth on column aj
    And so on endlessly as per the requirement.

    Any help will be highly appreciated.

    Thanking you in anticipation.
    Attached Files Attached Files
    Sincerely,

    mso3

  2. #2
    Forum Expert
    Join Date
    08-02-2013
    Location
    Québec
    MS-Off Ver
    Excel 2003, 2007, 2013
    Posts
    1,412

    Re: Getting compile error sub or function not define

    Hi,

    Maybe like this :

    Please Login or Register  to view this content.
    GC Excel

    If this post helps, then click the star icon (*) in the bottom left-hand corner of my post to Add reputation.

  3. #3
    Forum Contributor
    Join Date
    06-29-2014
    Location
    India
    MS-Off Ver
    2010 Windows 10 64 bits
    Posts
    1,269

    Re: Getting compile error sub or function not define

    Hi GC Excel,
    Excellent!
    It's working fine but only two revisions are require to complete it.

    I want a remark in cell d7 lc sheet showing the number of duplicate lc.
    For ex. first time in 'Duplicate1'; second time 'Duplicate 2'; third time 'Duplicate 3' and so on endlessly. This remark should be in red colour and bold font.
    If a user enter a register number in g7 lc sheet which is not available in register sheet then a pop up message should show as 'The register number is not found!' and exit sub.

    After this amendment the problem will be solved.

    Thank you very much.

  4. #4
    Forum Expert
    Join Date
    08-02-2013
    Location
    Québec
    MS-Off Ver
    Excel 2003, 2007, 2013
    Posts
    1,412

    Re: Getting compile error sub or function not define

    Ok, try this then :

    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    06-29-2014
    Location
    India
    MS-Off Ver
    2010 Windows 10 64 bits
    Posts
    1,269

    Re: Getting compile error sub or function not define

    Hello GC Excel,

    Excellent! Excellent! Excellent!

    Absolutely perfect as per my requirement.

    By heart I appreciate you for your kind cooperation to solve my problem.

    Thank you.

    All the best!

  6. #6
    Forum Contributor
    Join Date
    06-29-2014
    Location
    India
    MS-Off Ver
    2010 Windows 10 64 bits
    Posts
    1,269

    Re: Getting compile error sub or function not define

    Hi gc excel,
    Sorry! Today I do a little amendment in the code to show pop up message if a user run a macro if there is no register number in g7 lc sheet. I am getting compile error 'type mismatch' on the word 'RegNum'.

    Please suggest me a correction.

    Please Login or Register  to view this content.
    Thank you and sorry for trouble.

    Have a nice day!
    Last edited by mso3; 12-14-2014 at 01:32 AM.

  7. #7
    Forum Expert
    Join Date
    08-02-2013
    Location
    Québec
    MS-Off Ver
    Excel 2003, 2007, 2013
    Posts
    1,412

    Re: Getting compile error sub or function not define

    Hi mso3,

    Here your revised code :


    Please Login or Register  to view this content.

  8. #8
    Forum Expert
    Join Date
    08-02-2013
    Location
    Québec
    MS-Off Ver
    Excel 2003, 2007, 2013
    Posts
    1,412

    Re: Getting compile error sub or function not define

    Hi mso3,

    Here your revised code :


    Please Login or Register  to view this content.

  9. #9
    Forum Contributor
    Join Date
    06-29-2014
    Location
    India
    MS-Off Ver
    2010 Windows 10 64 bits
    Posts
    1,269

    Re: Getting compile error sub or function not define

    Hi GC excel,
    Thank you for updated version to meet my requirement. It's working fine with correct output.

    I appreciate you for the same.

    Thank you and have a nice day.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Function Error: Compile error: Expected: list separator or )
    By goss in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-05-2014, 02:10 PM
  2. [SOLVED] Compile Error 'Sub or Function is not define' error on Private Sub Getdata()
    By HafizuddinLowhim in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-24-2014, 11:17 AM
  3. Getting compile error sub or function not define
    By mso3 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-01-2014, 11:01 AM
  4. Run-time error '1004': Application-define or object define error
    By patua in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 03-26-2014, 05:32 PM
  5. [SOLVED] Compile error user defined type not define
    By mukeshbaviskar in forum Excel Programming / VBA / Macros
    Replies: 20
    Last Post: 11-14-2013, 10:40 PM

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1