+ Reply to Thread
Results 1 to 9 of 9

Insert Formula into empty cell

  1. #1
    Registered User
    Join Date
    05-28-2020
    Location
    Poland
    MS-Off Ver
    O365,
    Posts
    84

    Insert Formula into empty cell

    Hello everyone,

    I am trying to build a failsafe, in case that a formula is being deleted.

    When I am using the following code, it works perfectly:

    Please Login or Register  to view this content.
    If I try to replace the formula with a more demanding one, doing a xlookup, I get a run-time error 1004:
    Application-defined or object-defined error.

    I tried the following:

    Please Login or Register  to view this content.
    could the two "" in the formula cause a problem? I also tried to put the formula itself into a variable to copy to destination
    but that also did not work.

    Maybe you know, where I am making a mistake?

    It would be a nice to have

    Thank you very much for the hellp,

    Mike

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

    Re: Insert Formula into empty cell

    Hi there,

    Knee-jerk and untested suggestion - try:

    Please Login or Register  to view this content.

    Hope this helps.

    Regards,

    Greg M

  3. #3
    Registered User
    Join Date
    05-28-2020
    Location
    Poland
    MS-Off Ver
    O365,
    Posts
    84

    Re: Insert Formula into empty cell

    Hello Greg,

    Thanx for helping but unfortunately not...

    If we won't figure it out, I have also Plan B,

    I just hide the first row with all the formulas and continue at row 2, that works for me... figured it out after I sent the question
    but there might is someone out there, who needs a challenge

    Thanx a lot,

    Much appreciated

  4. #4
    Valued Forum Contributor
    Join Date
    07-23-2018
    Location
    UK
    MS-Off Ver
    365 32bit Win
    Posts
    466

    Re: Insert Formula into empty cell

    As well as the """" needed, it looks like you're using a ; to delimit the arguments.
    On my machine Xlookup arguments are delimited by a comma.

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    05-28-2020
    Location
    Poland
    MS-Off Ver
    O365,
    Posts
    84

    Re: Insert Formula into empty cell

    yes, that is correct but it depends in which country/region you are. And as soon as there are dates, it becomes even more complicated

    but as you saw correctly, I have to use the semicolon for my code and not commas

  6. #6
    Valued Forum Contributor
    Join Date
    07-23-2018
    Location
    UK
    MS-Off Ver
    365 32bit Win
    Posts
    466

    Re: Insert Formula into empty cell

    Are you able to successfully add the formula manually?
    Are the references, clientdata[clientNr] etc, all valid?

  7. #7
    Registered User
    Join Date
    05-28-2020
    Location
    Poland
    MS-Off Ver
    O365,
    Posts
    84

    Re: Insert Formula into empty cell

    Yes they are, because I use them successfully but wanted a backup in case that someone by mistake is deleting the formula, so I can implement them again.

  8. #8
    Valued Forum Contributor
    Join Date
    07-23-2018
    Location
    UK
    MS-Off Ver
    365 32bit Win
    Posts
    466

    Re: Insert Formula into empty cell

    Hmm I don't know then. Those were the only things giving me the 1004.

    For me
    Please Login or Register  to view this content.
    works.

  9. #9
    Registered User
    Join Date
    05-28-2020
    Location
    Poland
    MS-Off Ver
    O365,
    Posts
    84

    Re: Insert Formula into empty cell

    don't worry, I have a Plan B, and I appreciate the help !

+ 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. Replies: 5
    Last Post: 07-28-2022, 05:12 AM
  2. If cell is not empty - insert formula to another cell
    By derics in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-28-2018, 03:44 AM
  3. [SOLVED] Insert vlookup formula into next empty cell in column B
    By JamesT1 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-12-2016, 05:55 AM
  4. If empty then insert formula and comment
    By rodgersmg in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-11-2014, 03:31 AM
  5. How to find empty cell and insert vlookup formula
    By sathu in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-14-2013, 10:02 AM
  6. [SOLVED] Find empty cells in a range and insert formula in adjacent cell
    By macronovice1 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-25-2012, 03:06 PM
  7. [SOLVED] Insert and sum in empty cell
    By salsal in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-05-2006, 11:20 AM

Tags for this Thread

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