+ Reply to Thread
Results 1 to 13 of 13

Some part(red marked) in vba code not working

  1. #1
    Forum Contributor satputenandkumar0's Avatar
    Join Date
    11-08-2012
    Location
    Pune, India
    MS-Off Ver
    Office xp & Office 2007
    Posts
    398

    Some part(red marked) in vba code not working

    Dear Mambers,

    I have below VBA Code which run well but red marked code is not working means it is not entering the data in to "Dispatch" sheet


    Please Login or Register  to view this content.
    Regards,
    Nandkumar S.
    Regards,
    Nandkumar S.
    ---------------------------------------------------------------
    Don't forget to Click on * if you like my solution.

  2. #2
    Forum Contributor satputenandkumar0's Avatar
    Join Date
    11-08-2012
    Location
    Pune, India
    MS-Off Ver
    Office xp & Office 2007
    Posts
    398

    Re: Some part(red marked) in vba code not working

    Dear Members,

    for more clarification pls find attached file. In this File I search for Thc No. details of thc displays in user form. But code for Entering the data in to Dispatch sheet is not working. pls look in to
    Attached Files Attached Files

  3. #3
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Some part(red marked) in vba code not working

    Please Login or Register  to view this content.
    If this line is meant

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    and trying to find the lastrow, you should remove set and change the name of the variable in to long, since Objects can only be set an objects

  4. #4
    Forum Contributor satputenandkumar0's Avatar
    Join Date
    11-08-2012
    Location
    Pune, India
    MS-Off Ver
    Office xp & Office 2007
    Posts
    398

    Re: Some part(red marked) in vba code not working

    thanks for replying,

    I have to insert data to Dispatch sheets which is found from data sheets, I am newbie in VBA. Can you please correct all code.

  5. #5
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Some part(red marked) in vba code not working

    All the red line will disappear if you had corrected the top line
    Replace
    Please Login or Register  to view this content.
    With

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.

  6. #6
    Forum Contributor satputenandkumar0's Avatar
    Join Date
    11-08-2012
    Location
    Pune, India
    MS-Off Ver
    Office xp & Office 2007
    Posts
    398

    Re: Some part(red marked) in vba code not working

    Dear sir,

    I tried this but not working. Kindly see attached file.

    Regards,
    Nandkumar S.

  7. #7
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Some part(red marked) in vba code not working

    What is not working? I have not looked at the code itself, but spotted the error.

  8. #8
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Some part(red marked) in vba code not working

    Okay

    Please Login or Register  to view this content.

  9. #9
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Some part(red marked) in vba code not working

    Or you can use this short

    Please Login or Register  to view this content.
    Instead of these lines

    Please Login or Register  to view this content.

  10. #10
    Forum Contributor satputenandkumar0's Avatar
    Join Date
    11-08-2012
    Location
    Pune, India
    MS-Off Ver
    Office xp & Office 2007
    Posts
    398

    Re: Some part(red marked) in vba code not working

    I don't know why but it's not stamping the value in Dispatch Sheet

  11. #11
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Some part(red marked) in vba code not working

    It does, I have tested it. See attached.
    Attached Files Attached Files

  12. #12
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,646

    Re: Some part(red marked) in vba code not working

    The code works for me as long as a valid THC number is entered and a match for it found in column B on 'data'.

    Had to change 2 lines of code in the uploaded workbook to match the code in your first post.

    In the workbook you had Sheets("Dispatch"). in front of both these lines which would cause an error and isn't needed - LastRow already refers to 'Dispatch'.
    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

  13. #13
    Forum Contributor satputenandkumar0's Avatar
    Join Date
    11-08-2012
    Location
    Pune, India
    MS-Off Ver
    Office xp & Office 2007
    Posts
    398

    Re: Some part(red marked) in vba code not working

    Sorry Boss,

    I am very very sorry to confusing to you. There was little mistake from my side. I have corrected it and now code is working fine.

    Thanks a lot.

    Regards,
    Nandkumar S.

+ 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. Replies: 2
    Last Post: 03-09-2013, 04:30 AM
  2. Replies: 0
    Last Post: 02-28-2013, 03:11 PM
  3. [SOLVED] MY code marked red
    By Alexander_Golinsky in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-25-2012, 02:38 PM
  4. Part Code + part no combination for list box
    By suhas_shah in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-25-2006, 07:28 PM
  5. 2nd part of formula not working
    By dbl in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-17-2005, 03:05 PM

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