Looping trough all workbooks in a folder an their worksheet. Action is to paste special, so that there is no formula

  • Hello, this might be a tough ask, but is it possible to make the code delete the entire row if a row on M:M has this symbol "-" (It appears if there's noting for the formula. There are few expiations, if it is a double line "--" don't delete, only if it's one line "-")?Because now I'm getting crazy amount of empty rows. Before the table did the filtering but the code removes it.


    Or maybe ithe code coule crate a new white table for the active sheet, range B7 to B 400 and then filter with this '-'. I got some good code for filtering and creating table I get back to this.


    Also I'm having trouble with the of xlsm files. The coded seems not to detect them.

  • Here:

    Code: Turn total row off for paste.value
    Sub Totalrow()
    
        Range("B2").Select
        ActiveSheet.ListObjects(1).ShowTotals = False
    End sub
    Code: Create Table from range
    Sub ConvertToTable()
    
      
      If ActiveSheet.ListObjects.Count < 1 Then
        ActiveSheet.ListObjects.Add(xlSrcRange, Range("B7:M400"), , xlNo).Name = ActiveSheet.Name
      End If
    
    
    End Sub
    Code: Filter in new table
    Sub Autofilter()
    
    ActiveSheet.ListObjects(1).Range.Autofilter Field:=11, Criteria1:="-"
    
    End Sub
    Code: Select total row after table is done
    Sub Totalrow()
    
        Range("B2").Select
        ActiveSheet.ListObjects(1).ShowTotals = False
    End sub

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!