+ Reply to Thread
Results 1 to 4 of 4

Overwrite warning

  1. #1
    Registered User
    Join Date
    01-22-2014
    Location
    USA
    MS-Off Ver
    Excel 2013
    Posts
    25

    Overwrite warning

    Hi,

    I have some code in a form that finds the matching row based on a text box and copies the data to that particular row.

    Here's the code:

    Please Login or Register  to view this content.
    This works great, but if there is already data in the particular row that it finds, it gets overwritten. Is there a way to have a warning pop up if any data is in the found row, so the user doesn't accidentally overwrite a row's data?

    Thanks!!
    Marc

  2. #2
    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,463

    Re: Overwrite warning

    Use Count, COUNTA, or CountIf to check the range before you overwrite it.
    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


  3. #3
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: Overwrite warning

    Have a look at this code from excel guru and adapt it to use
    Please Login or Register  to view this content.
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

  4. #4
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: Overwrite warning

    Perhaps like such...Untested
    Please Login or Register  to view this content.

+ 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. Do Nothing if about to overwrite
    By TechKnowledge in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-28-2015, 11:40 PM
  2. Warning message box - Overwrite data, Y / N
    By Infish in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-02-2014, 02:41 AM
  3. Excel overwrite
    By andrei10bc in forum Excel General
    Replies: 2
    Last Post: 11-13-2012, 05:20 AM
  4. [SOLVED] Macro with "save as" --- Need excel to overwrite a file without a prompt to overwrite
    By tsmith1 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-21-2012, 10:54 AM
  5. VBA help to overwrite contents
    By pallavip06 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-22-2011, 09:15 AM
  6. Prevent data cell overwrite but allow blank cell overwrite
    By Squasher in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-09-2011, 09:24 AM
  7. overwrite
    By SP in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-22-2005, 02:06 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