ProNkrastinator & Tablet
Hey Tablet, I’ve got a spreadsheet that predicts when I’ll finally get to a design sprint, but I need a clean layout that won’t judge my typos. Care to share a code snippet that can survive a last‑minute chaos?
Sure thing, here’s a tiny VBA macro that will clean up your sheet, trim spaces, auto‑fit columns and apply a minimalistic style so the typos don’t look ugly. Just drop it into the Visual Basic editor (Alt+F11), run it, and you’re good to go.
```vba
Sub CleanUpDesignSprint()
Dim ws As Worksheet
Dim rng As Range
' Loop through all worksheets
For Each ws In ThisWorkbook.Worksheets
' Define the used range
Set rng = ws.UsedRange
' Trim spaces in all cells
rng.Replace What:=" ", Replacement:=" ", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False
' Auto‑fit columns
rng.EntireColumn.AutoFit
' Simple, clean formatting
With rng
.Font.Name = "Calibri"
.Font.Size = 10
.HorizontalAlignment = xlLeft
.VerticalAlignment = xlCenter
.WrapText = False
.NumberFormat = "General"
End With
Next ws
End Sub
```
Just press F5 to run it, and your spreadsheet will look tidy. No judgment of typos—just clean, readable data.