Consulting

Results 1 to 6 of 6

Thread: Delete empty rows

  1. #1
    VBAX Contributor
    Joined
    Feb 2005
    Posts
    151
    Location

    Delete empty rows

    Hi to all,



    I have 2 questions regarding the file attached.



    So the first one is how can I delete empty rows automatically for example whit a macro.

    I already see one post of the forum that talk about this question but doesn?t work in my case, and I try to adapt to my question but without success.



    The second question is:



    In the attached file you guys can see that in the column B I have a cell that contain the word ?Data? for example cell B4, B31, 56, etc.

    What I pretend is every time that I find this word I want to put in right cell (for example C4, C31, C56, etc) the value that is in the cell C3, C30, C56, etc.



    I don?t now if you guys will understand this doubt, but if you have any doubt please let me now ok?



    Best regards,



    Ismael

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Select cells B4 down to the end of the list
    Menu Data>Filter>Autofilter
    Click the arrow in B4
    Select Blanks from the bottom of the list
    Delete all the rows where the row number is blue
    Menu Data>Filter>Autofilter
    Done!

    Problem with a formula for the second bit is that it will overwite C30 unless you just insert in C4, C31, etc. which seems self-defeating.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    VBAX Contributor
    Joined
    Feb 2005
    Posts
    151
    Location
    Hi,

    In first place thanks for the help.

    I just don't full understand what you said regardaing the second bit, can you give me one explanation in more detail.

    thanks

    Ismael

  4. #4
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Quote Originally Posted by Ismael
    Hi,

    In first place thanks for the help.

    I just don't full understand what you said regardaing the second bit, can you give me one explanation in more detail.
    What I mean is that could put a formula in say C4. But you would want to copy it down which mean s that you would overwrite the values in those cells, which is hard as that is where you will get the value when the B column = Data.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  5. #5
    VBAX Contributor
    Joined
    Feb 2005
    Posts
    151
    Location
    Hi,

    sorry my mistake, I don't explain well what I pretend.
    So in the file attach, in the green cells you will see that for each "group" of data I repeat the number that is in cell C3, C30, etc.

    Is that what I pretend to do in one automatically way, because the original file is very large to do this manually.

    I hope that now you can help me.

    best regards,

    Ismael

  6. #6
    VBAX Contributor
    Joined
    Feb 2005
    Posts
    151
    Location
    Hi,

    Problem solved. I search in another forum (MrExcel) and I find a formula that after same adjust works fine in my case.

    The formula is:
    PHP Code:
    =IF(ISNUMBER(B5);LOOKUP(9.99999999999999E+307;$C$1:C5);""
    as you can see in the file attach everythnig works fine now.

    Thanks.

    Best regards,

    Ismael
    Last edited by Aussiebear; 04-27-2023 at 08:10 PM. Reason: Added code tags

Posting Permissions

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