+ Reply to Thread
Results 1 to 13 of 13

exclude zero or empty two blank cells together for the same row when copy data

  1. #1
    Forum Contributor
    Join Date
    02-08-2021
    Location
    africa
    MS-Off Ver
    2016
    Posts
    395

    exclude zero or empty two blank cells together for the same row when copy data

    Hi guys
    I want copying data for columns C,D,E,F and last three columns PU,SA,BL with ignore empty or zero for two cells together in the same row for columns PU,SA . so every week I will add new three columns PU,SA,BL should deal with last three columns PU,SA,BL because will change in location when matching the headers , also should update second sheet based on change first sheet.
    notice : should exclude TOTAL row from this condition totally .
    I want create whole report as I did it in second sheet with the formatting and borders .

    thanks
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Cool Hi, try this !


    According to your attachment a starter Excel basics VBA demonstration to paste only to the SH1 worksheet module :

    PHP Code: 
    Sub Demo1()
             
    Me.Next.UsedRange.Clear
        With UsedRange
    .Columns
             
    [XFC2].Formula "=(C2<>""TOTAL"")*SUM(" & .Cells(2, .Count 2).Resize(, 2).Address(0) & ")"
            
    .AdvancedFilter 1, [XFC1:XFC2]
             [
    XFC2].Clear
             Union
    (.Item("A:D"), .Item(.Count 2).Resize(, 3)).Copy Me.Next.[A1]
        
    End With
             
    If FilterMode Then ShowAllData
    End Sub 
    ► Do you like it ? ► So thanks to click on bottom left star icon « Add Reputation » !
    Last edited by Marc L; 05-06-2023 at 09:36 AM. Reason: OP changed the rules !!

  3. #3
    Forum Contributor
    Join Date
    02-08-2021
    Location
    africa
    MS-Off Ver
    2016
    Posts
    395

    Re: exclude zero or empty two blank cells together for the same row when copy data

    thanks !
    just odd case occurs for last item CRF25 if this item doesn't copy to second sheet because of it contains empty or zero cells and try modify by add numeric values to copy to second sheet in reality will copy but also repeat copying item in column A without repeat copy D:F and PU,SA,BL

  4. #4
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Arrow Re: exclude zero or empty two blank cells together for the same row when copy data


    Always works as expected on my side whatever the case, as with the Excel basics advanced filter
    it is very not possible to 'repeat' anything so I can't guess what could be the bad on yours !

  5. #5
    Forum Contributor
    Join Date
    02-08-2021
    Location
    africa
    MS-Off Ver
    2016
    Posts
    395

    Re: exclude zero or empty two blank cells together for the same row when copy data

    just write numeric value except zero in P2 and look what happens.
    Attached Files Attached Files

  6. #6
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Arrow Re: exclude zero or empty two blank cells together for the same row when copy data


    As I wrote « according to your attachment » so as always your bad 'cause you have modified the OUPUT layout ‼

    Post #2 demonstration updated just removing the useless column A …

  7. #7
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,595

    Re: exclude zero or empty two blank cells together for the same row when copy data

    Quote Originally Posted by MKLAQ View Post
    Hi guys
    I want copying data for columns C,D,E,F and last three columns PU,SA,BL with ignore empty or zero for two cells together in the same row for columns PU,SA .
    Please Login or Register  to view this content.
    Last edited by jindon; 05-06-2023 at 10:11 AM.

  8. #8
    Forum Contributor
    Join Date
    02-08-2021
    Location
    africa
    MS-Off Ver
    2016
    Posts
    395

    Re: exclude zero or empty two blank cells together for the same row when copy data

    @Mac L I expect the serial numbers in column A as I did it in OP.

  9. #9
    Forum Contributor
    Join Date
    02-08-2021
    Location
    africa
    MS-Off Ver
    2016
    Posts
    395

    Re: exclude zero or empty two blank cells together for the same row when copy data

    @jindon
    thanks , can also insert column A ITEM and auto numbers based on data has copied ,please?

  10. #10
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Arrow Re: exclude zero or empty two blank cells together for the same row when copy data


    Quote Originally Posted by MKLAQ View Post
    @Mac L I expect the serial numbers in column A as I did it in OP.
    The reason why my original starter procedure was keeping the useless column A but you delete it in your last attachment ‼
    As you already got the way to auto numbering a column in your previous threads - it's time to read and learn ! -
    so I let you do the 'cosmetics', the 'useless' …
    Anyway thanks for the rep' !

  11. #11
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,595

    Re: exclude zero or empty two blank cells together for the same row when copy data

    Please Login or Register  to view this content.

  12. #12
    Forum Contributor
    Join Date
    02-08-2021
    Location
    africa
    MS-Off Ver
    2016
    Posts
    395

    Re: exclude zero or empty two blank cells together for the same row when copy data

    As you already got the way to auto numbering a column in your previous threads
    I know .
    you said
    According to your attachment a starter Excel basics VBA demonstration to paste only to the SH1 worksheet module :
    so you missed based on my attachment
    it's time to read and learn !
    thanks for your advice
    it's not problem about autonumbering , but when somebody write the code I don't think hard to do that.
    just to make the matter is completed
    thanks for your code

  13. #13
    Forum Contributor
    Join Date
    02-08-2021
    Location
    africa
    MS-Off Ver
    2016
    Posts
    395

    Re: exclude zero or empty two blank cells together for the same row when copy data

    @jindon
    I appreciate for your effort & time
    The code works efficiently without any deficiencies
    thanks very much

+ 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. Dynamic Chart - How to exclude data tin blank cells
    By Nickf74 in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 05-24-2021, 12:51 PM
  2. Transpose and Manipulate Data - Exclude Blank cells
    By Snowflake68 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-21-2016, 02:21 PM
  3. Exclude Empty Cells in a Data Validation List
    By skip2mylew in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-22-2013, 07:05 PM
  4. Selection of loop data, move copy and paste data, and exclude blank rows
    By mav02004 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-18-2013, 10:20 AM
  5. Replies: 4
    Last Post: 01-25-2011, 09:37 AM
  6. Counting data in non blank cells and exclude certain data from the count
    By JohnG73 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-04-2007, 04:08 PM
  7. How to exclude cells that are empty?
    By aijihz in forum Excel General
    Replies: 1
    Last Post: 03-30-2005, 02: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