1

I'm having a problem with an excel dictionary that have hidden cells and it is giving me headches to clean it. So I got this code in VBA. But I want it in VBScript so I can execute it straight from Stata with no need of opening the sheet to delete the cells

the code in VBA:

Sub exclui_celulas_ocultas()

Dim lastRow
lastRow = 1000
    For iCntr = lastRow To 1 Step -1
        If Rows(iCntr).Hidden = True Then Rows(iCntr).EntireRow.Delete
    Next
End Sub

Also I'd like to make the "lastRow" generic, instead of specifying a constant.

Thanks

Apolo Reis
  • 97
  • 7

0 Answers0