Results 1 to 20 of 104

Thread: Creating Multiple Tables Using Loop in VBA. I still want to add new sheets and add

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Knowledge Base Approver VBAX Wizard p45cal's Avatar
    Joined
    Oct 2005
    Location
    Surrey UK
    Posts
    5,961
    Your formulae don't take into account Lob and SubLob!
    They will be considerably longer. In a bid to shorten them, several of them show "" when it's going to be zero, viz:
    =IF(SUMIF(Consolidated!$C:$C,$B3,Consolidated!$P:$P)=0,"",SUMIF(Consolidated!$C:$C,$B3,Consolidated!$P:$P))
    where the blue is a replica of the red.
    In a bid to shorten the formulae, did you know that you can set the whole sheet to show zeroes as blanks in Options? (untick the box at Options|Advanced|Display Options for this worksheet|Show a zero in cells that have zero value).
    This affects ALL the cells on that sheet. Code can do it (ActiveWindow.DisplayZeros = False). Can we use it?
    [There is another way using cell formatting where we could format all cells in a table to hide zero values - up to you]

    ps. you could have included Lob/SubLob considerations in your formulae.
    Last edited by Aussiebear; 03-24-2025 at 05:52 AM.
    p45cal
    Everyone: If I've helped and you can't be bothered to acknowledge it, I can't be bothered to look at further posts from you.

  2. #2
    VBAX Tutor
    Joined
    Jan 2020
    Posts
    204
    Location
    Quote Originally Posted by p45cal View Post
    Your formulae don't take into account Lob and SubLob!
    Sorry I forgot to indicate that in my actual workbook, the first table is always the overall per LOB that's why the workbook I sent with a table that has formula doesn't take the LOB and Sub LOB into consideration.

    Quote Originally Posted by p45cal View Post
    In a bid to shorten the formulae, did you know that you can set the whole sheet to show zeroes as blanks in Options? (untick the box at Options|Advanced|Display Options for this worksheet|Show a zero in cells that have zero value).
    Sorry I am really new to this, I am not aware that can be done.. But thank you I learned something new

    Quote Originally Posted by p45cal View Post
    This affects ALL the cells on that sheet. Code can do it (ActiveWindow.DisplayZeros = False). Can we use it?
    Yes.

    Quote Originally Posted by p45cal View Post
    [There is another way using cell formatting where we could format all cells in a table to hide zero values - up to you]
    Whichever you think is best. I really have no other idea besides the =""

  3. #3
    Knowledge Base Approver VBAX Wizard p45cal's Avatar
    Joined
    Oct 2005
    Location
    Surrey UK
    Posts
    5,961
    Quote Originally Posted by jazz2409 View Post
    Sorry I forgot to indicate that in my actual workbook, the first table is always the overall per LOB that's why the workbook I sent with a table that has formula doesn't take the LOB and Sub LOB into consideration.
    Your formulae don't take into account even LOB. Do I take it this table resides on its own sheet and does NOT take into account either Lob or SubLob?
    p45cal
    Everyone: If I've helped and you can't be bothered to acknowledge it, I can't be bothered to look at further posts from you.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •