+ Reply to Thread
Results 1 to 11 of 11

Userform overwriting previous entries

  1. #1
    Forum Contributor
    Join Date
    01-18-2012
    Location
    nr Salisbury, UK
    MS-Off Ver
    Excel 2010
    Posts
    126

    Userform overwriting previous entries

    This may be classed as a cross thread, as original ended up in ‘General’ due to oversite, but still not resolved things.
    Other thread http://www.excelforum.com/showthread...t=#post4575862

    Have one aspect of the UserForm to resolve as there is still a flaw that need to code for or Error handle.

    Data is entered where supposed to; it ignores blanks above last entry and puts data in next empty, using R as reference range for next blank row, looking up from R22.

    Problem comes when range R9:R22 is full (may be with blank rows in it). If another entry is then made that entry will then overwrite an entry already there, where that might be entirely depends on whether there is any blank rows, if no blanks it will overwrite R10

    I need to prevent this from happening.
    Simplest being msg box telling you R22 is not blank so go and insert more rows.
    Ideal solution would be to use a NamedRange from the Totals Row (i.e., T24 (Cash Paid), this book is only a demo so only few rows, actual one will have 500 – 1000, T24 (Cash Paid) will be anywhere within range T500:T1000.

    My trouble is; I think one of the above would solve it but I don’t have the knowledge to implement it, can anyone help?
    Attached Files Attached Files

  2. #2
    Forum Expert JapanDave's Avatar
    Join Date
    06-10-2008
    Location
    The grid, I got in!
    MS-Off Ver
    Excel 2010/13
    Posts
    1,696

    Re: Userform overwriting previous entries

    What is the code that is giving you issues? I am too tired to look through all that.

    Cheers
    Be fore warned, I regularly post drunk. So don't take offence (too much) to what I say.
    I am the real 'Napster'
    The Grid. A digital frontier. I tried to picture clusters of information as they moved through the computer. What did they look like? Ships? motorcycles? Were the circuits like freeways? I kept dreaming of a world I thought I'd never see. And then, one day...

    If you receive help please give thanks. Click the * in the bottom left hand corner.

    snb's VBA Help Files

  3. #3
    Forum Contributor
    Join Date
    01-18-2012
    Location
    nr Salisbury, UK
    MS-Off Ver
    Excel 2010
    Posts
    126

    Re: Userform overwriting previous entries

    Hi JapanDave,

    This is the part that I am referring to:

    Please Login or Register  to view this content.
    Using this just to test for blanks but it is returning R9, when R9 clearly contains data,
    so something odd going on

    Please Login or Register  to view this content.

  4. #4
    Forum Contributor
    Join Date
    01-18-2012
    Location
    nr Salisbury, UK
    MS-Off Ver
    Excel 2010
    Posts
    126

    Re: Userform overwriting previous entries

    Been trying various things but still not getting the right outcome. Regarding this part, have wondered what the significance of using [R9] as opposed to (R9) in the snippet below.

    Please Login or Register  to view this content.

  5. #5
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Userform overwriting previous entries

    Hi julhs

    Try this for finding the last row in Column R...
    Please Login or Register  to view this content.
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  6. #6
    Forum Contributor
    Join Date
    01-18-2012
    Location
    nr Salisbury, UK
    MS-Off Ver
    Excel 2010
    Posts
    126

    Re: Userform overwriting previous entries

    Hi Jaslake

    Thanks, it works perfectly as I would have expected. BUT!!

    In the actual Accounts Book there will be Summary data in the range O24:R100 so there is effectively a bottom line to the input section and I don’t want data being inadvertently added into it. So it’s how to work around that issue that trying to deal with. (beat myself up more like)

    Don’t know if you’ve had a look at the attached Dummy book but the Summary section O24:R100 is actually missing, but you will see the effect of what happens when the next entry is made (into what is effectively a full column) because of the coded I've put in place to take account of the Summary Section.

    It’s very hard to explain what is happening, but it’s very clear if you made one more entry (may be 2)

  7. #7
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Userform overwriting previous entries

    Hi julhs

    It would be helpful if your Sample File has the same structure as your actual file.

    actual Accounts Book there will be Summary data in the range O24:R100

  8. #8
    Forum Contributor
    Join Date
    01-18-2012
    Location
    nr Salisbury, UK
    MS-Off Ver
    Excel 2010
    Posts
    126

    Re: Userform overwriting previous entries

    Hope this helps
    Attached Files Attached Files

  9. #9
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Userform overwriting previous entries

    Hi julhs

    Forum is squirrely...just going to upload the File..let me know...

    Please note the Formula change in your Total Lines...
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by jaslake; 02-07-2017 at 11:58 PM.

  10. #10
    Forum Contributor
    Join Date
    01-18-2012
    Location
    nr Salisbury, UK
    MS-Off Ver
    Excel 2010
    Posts
    126

    Re: Userform overwriting previous entries

    Hi jaslake

    Brilliant, you are an absolute star; you’ve sorted my conundrum and improved things massively

    I’m very grateful

    julhs

  11. #11
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Userform overwriting previous entries

    You're welcome...glad I could help.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

+ 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. cmdEdit overwriting previous record
    By lcartwright in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-26-2016, 10:36 PM
  2. [SOLVED] Information from userform overwriting data previously entered by same userform
    By ciresuark in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 03-20-2015, 02:10 PM
  3. Replies: 1
    Last Post: 09-03-2014, 12:46 AM
  4. UserForm that retains previous entries in history text box?
    By Stepic in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-05-2013, 06:10 AM
  5. copying multiple charts from excel to word overwriting previous charts
    By eric45 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-01-2013, 11:11 AM
  6. Copy/Paste to Next Empty Row Overwriting Previous Row When Column A Is Empty
    By grantfitz in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-19-2013, 04:34 PM
  7. Replies: 0
    Last Post: 10-14-2011, 12:09 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