+ Reply to Thread
Results 1 to 10 of 10

Data placement into Cell going to wrong row

  1. #1
    Spammer
    Join Date
    11-21-2014
    Location
    California
    MS-Off Ver
    2010
    Posts
    387

    Data placement into Cell going to wrong row

    I am trying to figure out why data in going into the wrong row with this code.

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    I would expect start seeing data in C6 of the "data" tab... but instead it is starting in cell C10.

    Any thoughts???
    Attached Files Attached Files

  2. #2
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,481

    Re: Data placement into Cell going to wrong row

    Hi there,

    This is a bit difficult to understand, because the code you posted cannot be located anywhere in the VBA CodeModules of the workbook you attached, and none of your worksheets is named "data". Are you sure that you attached the correct workbook?

    From your description of the problem (Cell C10 instead of Cell C6), I'd guess that four cells in Column A appear to be empty but actually contain blank characters.

    Hope this helps.

    Regards,

    Greg M

  3. #3
    Spammer
    Join Date
    11-21-2014
    Location
    California
    MS-Off Ver
    2010
    Posts
    387

    Re: Data placement into Cell going to wrong row

    Hi there. The code is not in the modules, but instead in the UserForm. if you double click on the "add" button you will see it there. I did check the cells in those rows, and unless i am missing something, could not locate anything that is in the rows that could be setting off this.

  4. #4
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,481

    Re: Data placement into Cell going to wrong row

    Hi again,

    I used the VB Editor "Find" command to search the Current Project for the texts "dt.Cells" and "dtRow" but was unable to locate them.

    On a more encouraging note, when I used the "Add Client" button to insert new records on the "ClientDB" worksheet, the new records were inserted in the correct (i.e. the next empty) row.

    Hope this helps,

    Regards,

    Greg M

  5. #5
    Spammer
    Join Date
    11-21-2014
    Location
    California
    MS-Off Ver
    2010
    Posts
    387

    Re: Data placement into Cell going to wrong row

    That is so odd.

    I have highlighted in Red the code that References this tab... maybe it will help??
    Please Login or Register  to view this content.
    I just tried it again, and added "Testing 1" to the form. When it adds the info to the other tabs, it puts it in the correct place.

    When it adds it to the "Data" tab it puts the info in row 14 instead of row 6. Before Running the userform, i highlighted from Row 6 Down to the end of the worksheet and cleared all contents just to make sure there was no data in those cells.
    Attached Files Attached Files
    Last edited by FDibbins; 05-05-2019 at 12:26 AM.

  6. #6
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,481

    Re: Data placement into Cell going to wrong row

    Hi again,

    Thanks for your feedback.

    Two points:

    1 - the workbook you posted (data.xlsm) is not the same as the workbook (CLwork.xlsm) you posted previously - no wonder I couldn't locate "dt.Cells" or "dtRow" in it!

    2 - when I used the "Add Client" button to insert new records on the "ClientDB" worksheet, the new records were inserted in the correct (i.e. the next empty) row.


    Hope this helps with the debugging process.


    Regards,

    Greg M

  7. #7
    Spammer
    Join Date
    11-21-2014
    Location
    California
    MS-Off Ver
    2010
    Posts
    387
    Greg

    If you go to the Data worksheet you will see where it is not properly working
    Last edited by AliGW; 05-05-2019 at 02:04 AM.

  8. #8
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,946

    Re: Data placement into Cell going to wrong row

    snuffnchess, please to not use the REPORT button to bring attention to your thread
    (FWIW, only mods and admin can see reported threads anyway)
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  9. #9
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,309

    Re: Data placement into Cell going to wrong row

    You are getting confused with your row counters and which sheet they refer to.
    Attachment 622994
    torachan

  10. #10
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,481

    Re: Data placement into Cell going to wrong row

    Hi again,

    Your code is assigning an incorrect value to the variable "dtRow"

    If you make the highlighted changes to your code the new entries will appear on the correct rows:

    Please Login or Register  to view this content.

    Hope this helps - please let me know how you get on.

    Regards,

    Greg M

+ 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] chart data and placement
    By jitterbug888 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-02-2017, 07:30 PM
  2. Variable placement linked data, including CELL COLOR...?
    By fourmurphys in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-13-2016, 04:22 PM
  3. Variable placement linked data, including CELL COLOR...?
    By fourmurphys in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-13-2016, 04:19 PM
  4. Variable placement linked data, including CELL COLOR...?
    By fourmurphys in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-13-2016, 04:19 PM
  5. cell placement
    By erickguz in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 09-28-2007, 04:45 AM
  6. cell placement based on value
    By seccard in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-12-2007, 05:43 PM
  7. excel cell placement by cursor
    By john coon in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-09-2005, 11:05 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