+ Reply to Thread
Results 1 to 16 of 16

Finding a specific row and inserting data

  1. #1
    Registered User
    Join Date
    10-11-2013
    Location
    Denmark
    MS-Off Ver
    Excel 2010
    Posts
    22

    Finding a specific row and inserting data

    Hello everybody

    My problem is fairly simple i guess, but I´m a beginner when it comes to VBA.
    I have a column with lots of rows. I want to locate a specific one and insert some data into this row at specific columns. This is what i have come up with so far:

    Please Login or Register  to view this content.
    It doesn´t work for me - whats wrong?
    In your answers, if you post code, please comment on it so i can understand - thanks and best regards.

  2. #2
    Valued Forum Contributor
    Join Date
    02-08-2012
    Location
    Newcastle, Australia
    MS-Off Ver
    Excel 2007 and Excel 2010
    Posts
    1,429

    Re: Finding a specific row and inserting data

    Hi,

    This would be a lot easier to help if you uploaded your workbook please, including an example of what the final product should look like.

    Thanks

  3. #3
    Registered User
    Join Date
    04-15-2010
    Location
    Lancashire, England
    MS-Off Ver
    Office 2007 SP3
    Posts
    21

    Re: Finding a specific row and inserting data

    Hi, if you could be clear about which part of the code does not work. Have you tried stepping through the code and checking the values of any variables to see which ones might be failing? Need more info.

  4. #4
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Finding a specific row and inserting data

    Hi,

    Here's a routine with the finder and a subroutine - let me know if it works:

    Please Login or Register  to view this content.
    Last edited by xladept; 03-04-2014 at 08:08 PM.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  5. #5
    Registered User
    Join Date
    10-11-2013
    Location
    Denmark
    MS-Off Ver
    Excel 2010
    Posts
    22

    Re: Finding a specific row and inserting data

    alright, here is the file and what I want to happen.
    Within the sheet "Production Data" theres is a box called Initial bending strengt. Here data a saved and stored in the sheet "Initial bending strenght" according to a certain date. I then want to store inition loss aswell under the correct date and board nr. So the save macro for the ignition loss should shearch for the row containing the right date and board nr and insert the information in the correct columns in that row.

    Best regards
    Attached Files Attached Files

  6. #6
    Valued Forum Contributor
    Join Date
    02-08-2012
    Location
    Newcastle, Australia
    MS-Off Ver
    Excel 2007 and Excel 2010
    Posts
    1,429

    Re: Finding a specific row and inserting data

    Hi,

    Your code works fine with a few minor changes (marked in red):
    Please Login or Register  to view this content.
    Hope this helps
    Last edited by ajryan88; 03-05-2014 at 03:43 PM.

  7. #7
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Finding a specific row and inserting data

    Hi DK,

    I tested and corrected the routine of post #4 - I think it's working now

  8. #8
    Registered User
    Join Date
    10-11-2013
    Location
    Denmark
    MS-Off Ver
    Excel 2010
    Posts
    22

    Re: Finding a specific row and inserting data

    Thank you so much for spending time on this, it worked perfectly with the changes you´ve added. Best Regards

  9. #9
    Valued Forum Contributor
    Join Date
    02-08-2012
    Location
    Newcastle, Australia
    MS-Off Ver
    Excel 2007 and Excel 2010
    Posts
    1,429

    Re: Finding a specific row and inserting data

    You're welcome

    Please don't forget to mark this thread as solved, and please click on the * next to any post(s) to say thanks to the poster(s)

  10. #10
    Registered User
    Join Date
    10-11-2013
    Location
    Denmark
    MS-Off Ver
    Excel 2010
    Posts
    22

    Re: Finding a specific row and inserting data

    Quote Originally Posted by ajryan88 View Post
    Hi,

    Your code works fine with a few minor changes (marked in red):
    Please Login or Register  to view this content.
    Hope this helps
    This is super - One last thing - Can you make it dependent on board nr aswell as date, so that it needs to look for date and board nr.?

  11. #11
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Finding a specific row and inserting data

    Hi DK,

    Try this:

    Please Login or Register  to view this content.

  12. #12
    Registered User
    Join Date
    10-11-2013
    Location
    Denmark
    MS-Off Ver
    Excel 2010
    Posts
    22

    Re: Finding a specific row and inserting data

    Quote Originally Posted by xladept View Post
    Hi DK,

    Try this:

    Please Login or Register  to view this content.
    Thanks First i tried this myself with and extra For Each cell command:
    Please Login or Register  to view this content.
    It doesn´t seem to work though :/

    Best regards

  13. #13
    Valued Forum Contributor
    Join Date
    02-08-2012
    Location
    Newcastle, Australia
    MS-Off Ver
    Excel 2007 and Excel 2010
    Posts
    1,429

    Re: Finding a specific row and inserting data

    I'm not 100% sure what you are trying to achieve, so I haven't actually tested this code apart from making sure that it compiles, but is this what you were trying to do?
    Please Login or Register  to view this content.

  14. #14
    Registered User
    Join Date
    10-11-2013
    Location
    Denmark
    MS-Off Ver
    Excel 2010
    Posts
    22

    Re: Finding a specific row and inserting data

    Quote Originally Posted by ajryan88 View Post
    I'm not 100% sure what you are trying to achieve, so I haven't actually tested this code apart from making sure that it compiles, but is this what you were trying to do?
    Please Login or Register  to view this content.
    This worked the way I had hoped, so thanks alot you guys!

    Best regards

  15. #15
    Valued Forum Contributor
    Join Date
    02-08-2012
    Location
    Newcastle, Australia
    MS-Off Ver
    Excel 2007 and Excel 2010
    Posts
    1,429

    Re: Finding a specific row and inserting data

    You're welcome

  16. #16
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Finding a specific row and inserting data

    You're welcome and thanks for the rep!

+ 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] Macro for inserting specific rows with data when there is a change in the column
    By KILOJulz in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-08-2013, 04:19 AM
  2. Finding a Specific Value using Non Linear Data
    By MINE in forum Excel General
    Replies: 3
    Last Post: 10-18-2011, 02:09 PM
  3. Finding specific data within cells
    By cquest in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-07-2011, 01:26 PM
  4. finding specific data in a row
    By fozzy9222 in forum Excel General
    Replies: 2
    Last Post: 05-26-2010, 04:42 PM
  5. finding specific data
    By steveori in forum Excel General
    Replies: 2
    Last Post: 08-12-2008, 05:40 AM

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