+ Reply to Thread
Results 1 to 7 of 7

Fill a cell with VBA if contents get deleted by User

  1. #1
    Registered User
    Join Date
    02-13-2019
    Location
    canada
    MS-Off Ver
    2010
    Posts
    56

    Fill a cell with VBA if contents get deleted by User

    So this is a little convoluted:


    Columns B:K
    Rows 14:59

    Column H has a formula in it which looks up a value based on column G - =IF(ISBLANK(C52),"",VLOOKUP(C52,'ET RATES'!$A$111:$M$122,'ET RATES'!$A$2,FALSE)) - However there will be some cases where this formula returns "Enter Cost", this will then be manually entered.

    I am trying to find a way to repopulate this formula if the manually entered values are deleted. The formula is in all cells in column H.

  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,522

    Re: Fill a cell with VBA if contents get deleted by User

    Fast answers need visual help. Please read the yellow banner at the top of this page on how to attach a file.
    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
    Registered User
    Join Date
    02-13-2019
    Location
    canada
    MS-Off Ver
    2010
    Posts
    56

    Re: Fill a cell with VBA if contents get deleted by User

    I think I have uploaded a sample.
    Attached Files Attached Files

  4. #4
    Forum Expert CheeseSandwich's Avatar
    Join Date
    12-22-2021
    Location
    Kent, England
    MS-Off Ver
    365 - 2404-17531.20128
    Posts
    1,361

    Re: Fill a cell with VBA if contents get deleted by User

    How about something like:
    Please Login or Register  to view this content.
    Hope this helps

  5. #5
    Registered User
    Join Date
    02-13-2019
    Location
    canada
    MS-Off Ver
    2010
    Posts
    56

    Re: Fill a cell with VBA if contents get deleted by User

    It keeps kicking me back a type mismatch on
    Please Login or Register  to view this content.
    I am wondering if it is possible to just copy the formula from the first non empty cell below?

    I may be barking up the wrong tree altogether and a separate sheet may be the way to go though.

  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,522

    Re: Fill a cell with VBA if contents get deleted by User

    Works for me. Have you typed the code or copied and pasted it?

  7. #7
    Forum Expert CheeseSandwich's Avatar
    Join Date
    12-22-2021
    Location
    Kent, England
    MS-Off Ver
    365 - 2404-17531.20128
    Posts
    1,361

    Re: Fill a cell with VBA if contents get deleted by User

    I reckon you could be editing more than one cell at a time, try this instead:

    Please Login or Register  to view this content.
    Last edited by CheeseSandwich; 01-12-2022 at 12:07 PM.

+ 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] move range cell data up 1 row to fill in deleted data
    By dad812 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-28-2018, 11:54 AM
  2. I need to COUNTIF even after cell contents are deleted
    By HannahWSU in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-06-2015, 09:10 AM
  3. [SOLVED] ClearContents of particular cells if the contents of another cell is deleted
    By nixonquierre in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-08-2015, 04:56 AM
  4. Replies: 5
    Last Post: 02-10-2013, 07:59 AM
  5. Clear contents in one cell when contents of another cell are deleted
    By rlbush2 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-22-2012, 10:29 PM
  6. [SOLVED] Combine Cell Contents to with a [return] or [fill with spaces] between each cells contents
    By jordan2322 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-16-2012, 11:24 PM
  7. Automatically delete cell contents if 1 cell deleted
    By BudParker in forum Excel General
    Replies: 2
    Last Post: 11-08-2009, 11:20 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