+ Reply to Thread
Results 1 to 8 of 8

Coding Error - VBA

  1. #1
    Forum Contributor
    Join Date
    10-28-2011
    Location
    United Kingdom
    MS-Off Ver
    Excel 2010
    Posts
    114

    Question Coding Error - VBA

    Hi
    I have tried to make some changes to a code and now it does not work! The coding is:
    Code:
    Please Login or Register  to view this content.
    I have attached an example if that helps, thanks.
    Attached Files Attached Files
    Last edited by sgp; 12-12-2011 at 10:32 AM.

  2. #2
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Coding Error - VBA

    hi sgp, there some mistakes in the code (underlined)

    Please Login or Register  to view this content.

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,447

    Re: Coding Error - VBA

    Try:

    Please Login or Register  to view this content.


    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  4. #4
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284

    Re: Coding Error - VBA

    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    10-28-2011
    Location
    United Kingdom
    MS-Off Ver
    Excel 2010
    Posts
    114

    Re: Coding Error - VBA

    Thanks watersev, TMS and Bob Phillips! - All solutions work great!

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,447

    Re: Coding Error - VBA

    Note that I have changed this:

    r = rFind.Row - 3

    To this:

    r = rFind.Row - 4

    As the code seemed to put the information in the wrong cells.


    Regards

  7. #7
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284

    Re: Coding Error - VBA

    Quote Originally Posted by TMShucks View Post
    Note that I have changed this:

    To this:

    As the code seemed to put the information in the wrong cells.

    Regards
    I changed Range("C4") to Range("C3") - same reason.

  8. #8
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Coding Error - VBA

    Wouldn't this suffice ?

    Please Login or Register  to view this content.
    To prevent non existing ID's you can fill a combobox with all valid ID's:

    Please Login or Register  to view this content.
    Last edited by snb; 12-13-2011 at 08:18 AM.



+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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