+ Reply to Thread
Results 1 to 14 of 14

Not pasting second formula for blanks

  1. #1
    Forum Contributor
    Join Date
    10-05-2017
    Location
    Altamonte Springs, FL
    MS-Off Ver
    Office 365
    Posts
    146

    Not pasting second formula for blanks

    Everything seems to check out, but can't get this to work.

    Please Login or Register  to view this content.
    My original formula does paste , but after that, I can't get the the blank cells to paste in second formula. I only added the copy/paste special in the code because I thought it would help to clear out the all the cells' first formula, but it didn't do anything.

    Trying to get a calculated date from another table. But, if it doesn't exist in that table, then I just want it to calculate 15 days less than the Hearing Date column in the same table. Any ideas what I'm doing wrong?

    Thank you!

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

    Re: Not pasting second formula for blanks

    Not sure what you mean by original formula and second formula?
    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 Contributor
    Join Date
    10-05-2017
    Location
    Altamonte Springs, FL
    MS-Off Ver
    Office 365
    Posts
    146

    Re: Not pasting second formula for blanks

    first formula is :

    Please Login or Register  to view this content.
    Second formula is further down in the code, for the blank cells:
    Please Login or Register  to view this content.

  4. #4
    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,425

    Re: Not pasting second formula for blanks

    Sorry it's taken a while to come back on this, been a bit busy.

    Can you post a sample workbook?

  5. #5
    Forum Contributor
    Join Date
    10-05-2017
    Location
    Altamonte Springs, FL
    MS-Off Ver
    Office 365
    Posts
    146

    Re: Not pasting second formula for blanks

    Was trying to delete this entry
    Last edited by jmklei0; 09-26-2020 at 02:57 PM.

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

    Re: Not pasting second formula for blanks

    Glad you got there.

    Not relevant and lost context now that OP has edited the previous post
    Last edited by TMS; 09-26-2020 at 03:46 PM.

  7. #7
    Forum Contributor
    Join Date
    10-05-2017
    Location
    Altamonte Springs, FL
    MS-Off Ver
    Office 365
    Posts
    146

    Re: Not pasting second formula for blanks

    I came back to say this isn't actually solved. I'm still working on it. I think I do have a solution, but need to tweak it.

  8. #8
    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,425

    Re: Not pasting second formula for blanks

    Post the workbook.

  9. #9
    Forum Expert
    Join Date
    10-06-2017
    Location
    drevni ruchadlo
    MS-Off Ver
    old
    Posts
    2,151

    Re: Not pasting second formula for blanks

    Quote Originally Posted by jmklei0 View Post
    ... I can't get the the blank cells to paste in second formula ...
    1. "Blank" cells are not "blank", there are formulas in them (?)
    2. Do not make such long entries in your vbe code (text of formula) as it blurs the "overall picture" of what you want to do
    Make the formula out of the smaller parts/blocks - see an example below
    3. Attach an example with the appropriate data layout in the worksheet (false data)

    Ad 2., e.g.:
    Please Login or Register  to view this content.

  10. #10
    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,425

    Re: Not pasting second formula for blanks

    Probably missing something here but, when you have a Structured Table, you only have to put the formula in once.

    So, maybe you need:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  11. #11
    Forum Contributor
    Join Date
    10-05-2017
    Location
    Altamonte Springs, FL
    MS-Off Ver
    Office 365
    Posts
    146

    Re: Not pasting second formula for blanks

    @TMS, I appreciate all your help. I didn't feel like the other post was the same, as I had tangented off this original, but I'll go along with it. I've been trying to figure out the solution and things have changed along the way. There's no way I could post this whole code and the related workbooks. The entire macro literally pulls three workbooks together to make a worksheet with multiple conditional formats, then 8 pivot tables. I'm trying to snippet because all else would be a waste of time and I'm being generous not getting everybody to dig through all of the code.

    This particular piece of code was originally bringing in a date from another table with a formula (if/match, which you can see above) That formula does its job. But, it came to my attention that not all of the dates were available from the lookup table. So, I'm trying to compensate by simply calculating the date (minus 15 days) instead, when they're missing. Ironically enough, if I can get this process correct, the final formula will be much longer - but one scientific step at time (and I don't need to muddy the question any more).

    I do know that the PET Ev Due column cells and the Hearing Date cells are not technically blank (for a reason I do not know - they have 0 length and are ""), so special blank cells will not work in this case.

    So far I've come up with this. I feel like it's really close to being correct, but I think the syntax for the integers (i) are misplaced. This code is the next line after the PET Evid Due column has its matches from the if/match formula. Then it runs this piece. This newest iteration doesn't seem to run (maybe Error goes to next line and skips this). You can see in the attachment what a sample would look like once we get to this point in the code. All I want it do is add the 15-less date to $F$6 in this sample, but leave the other rows alone.

    Please Login or Register  to view this content.
    As to just applying the HearingDate-15 formula once to the structured column (yes, everything in my code is based on structured tables), that won't work because some of the rows have the date set already from the if/match lookup formula that is already there.

    Nonetheless, all of this is to say that I appreciate your help and if you have a suggestion for moving the integer syntax around, or anything thing else that would make it even simpler, thank you.
    Attached Files Attached Files

  12. #12
    Forum Contributor
    Join Date
    10-05-2017
    Location
    Altamonte Springs, FL
    MS-Off Ver
    Office 365
    Posts
    146

    Re: Not pasting second formula for blanks

    Quote Originally Posted by porucha vevrku View Post
    2. Do not make such long entries in your vbe code (text of formula) as it blurs the "overall picture" of what you want to do
    Make the formula out of the smaller parts/blocks - see an example below
    Thank you. That is great advice. I do like keeping things easily readable and simple. My problem is that I have to get to that point. I'm working on so many formulas that keeping them straight is difficult enough. Hopefully I'll get to the point that I can update the syntax of my code like this. In fact, there are several parts that I could re-use pieces in multiple places.

  13. #13
    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,425

    Re: Not pasting second formula for blanks

    Please do not PM contributors. You MUST keep all conversations/updates/prompts in the thread.

    I really cannot offer any more help. The code you have provided is out of context so I cannot even copy and paste it into a new subroutine and compile it (in order to test it). I don't know what your variables refer to, and I'm not going to hazard a guess. For example, you refer to PET_EvidenceDue (as in With PET_EvidenceDue) and PET_EvidenceDue(i) so I don't know what this is. A variable? A Range? An Array?

  14. #14
    Forum Contributor
    Join Date
    10-05-2017
    Location
    Altamonte Springs, FL
    MS-Off Ver
    Office 365
    Posts
    146

    Re: Not pasting second formula for blanks

    Thanks again TMS. No harm meant trying to prompt action back on the thread. My apologies.

    I'm trying to keep this simple for anyone offering help. But, here is the full workbook for the macro. However, it requires two other files to fully operate. Attachments appears to only allow one upload. I've been on Excel Forum since 2017, but still consider myself new at this. If there is a way to get a second and third file attached, please let me know. But, it seems like just having the code might help.

    Thanks for taking a look.

    P.S. The (i) is supposed to be the row number in the loop sequence.
    Attached Files Attached Files
    Last edited by jmklei0; 09-30-2020 at 07: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. Replies: 1
    Last Post: 08-06-2019, 10:43 PM
  2. Exclude BLANKS and FORMULAE while pasting the data
    By preethamalluri in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 07-19-2018, 07:31 AM
  3. [SOLVED] Formula to count blanks and non-blanks with a dynamic range
    By brittdyer in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 07-12-2018, 07:45 AM
  4. BLANKS (Not Really Blanks) AND Rearrange ignoring blanks
    By shivspatil in forum Excel General
    Replies: 4
    Last Post: 02-02-2018, 08:28 AM
  5. [SOLVED] Pasting a formula that will navigate around blanks
    By coach.32 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-01-2015, 09:50 PM
  6. Pasting Blanks using a macro
    By TTomSawyer in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-16-2005, 12:05 PM
  7. Replies: 0
    Last Post: 02-22-2005, 12:06 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