Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ahixiltor/remove_empty_in_excel
https://github.com/ahixiltor/remove_empty_in_excel
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/ahixiltor/remove_empty_in_excel
- Owner: AHiXilTOr
- Created: 2023-12-11T16:17:35.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-12-26T16:15:54.000Z (about 1 year ago)
- Last Synced: 2023-12-26T17:55:55.044Z (about 1 year ago)
- Language: Python
- Size: 318 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Аналог через VBA 2007
```bash
Sub ProcessFilesInFolder()
Dim folderPath As String
Dim fileName As String
Dim wb As Workbook
Dim ws As Worksheet
Dim lastRow As Long
Dim lastColumn As Long
Dim tableRange As RangeApplication.ScreenUpdating = False
Application.Calculation = xlCalculationManual
Application.AutomationSecurity = msoAutomationSecurityLowfolderPath = ""
fileName = Dir(folderPath)
Do While fileName <> ""
Set wb = Workbooks.Open(folderPath & fileName)For Each ws In wb.Sheets
On Error Resume Next
ws.Unprotect
ws.Cells.SpecialCells(xlCellTypeBlanks).Delete Shift:=xlUplastRow = ws.Cells.Find("*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
lastColumn = ws.Cells.Find("*", SearchOrder:=xlByColumns, SearchDirection:=xlPrevious).ColumnSet tableRange = ws.Range(ws.Cells(1, 1), ws.Cells(lastRow, lastColumn))
tableRange.Borders.LineStyle = xlContinuous
Next wswb.Close SaveChanges:=True
fileName = Dir
LoopApplication.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic
Application.AutomationSecurity = msoAutomationSecurityByUI
End Sub