Delete Blank rows in Range till last row with data

This topic contains 2 replies, has 2 voices, and was last updated by Profile photo of Vishal Rao B Vishal Rao B 5 months, 2 weeks ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #38019
    Profile photo of Vishal Rao B
    Vishal Rao B
    Participant

    Hi All,

    I am looking for code to delete Blank rows in range or worksheet till last row with data.

    Any help or pointers would be much appreciated

    -Vishal

    #38020
    Profile photo of Yuan Li
    Yuan Li
    Participant

    If it's a csv file, it'll be easy.

    gc c:\temp\abc.csv | foreach {
    if($_.length -eq 0){
    }
    else
    {
    $_
    $_ | out-file C:\temp\abc_new.csv -Append
    
    }
    
    }
    

    Cheers
    Yuan

    #38081
    Profile photo of Vishal Rao B
    Vishal Rao B
    Participant

    I have .xlsx file, I am working with. which has some graphs and charts associated with it.

    Tried to use command which I have used with VBA code
    its not working

    $range = $WorkSheet.Range(“A4:AM206“).Range("A:A").SpecialCells(xlCellTypeBlanks).EntireRow.Delete

    -Vishal

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.