Last active
March 16, 2019 11:26
-
-
Save supergrass71/3c466dcb442cd66dc8d693f820e84569 to your computer and use it in GitHub Desktop.
[make a square cell grid] constructs a grid mad of square cells e.g. graph paper #vba, #excel
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub MakeSquareCells() | |
'// Create graph paper in Excel see http://www.erlandsendata.no/english/index.php?d=envbawssetrowcol | |
'if you want cm or inches | |
Dim noOfColumns As Integer, squareSide As Integer, i As Integer | |
noOfColumns = Application.InputBox(Prompt:="Select number of columns for grid (from column A:)", _ | |
Title:="Square Grid Maker", Default:=1, Type:=1) | |
squareSide = Application.InputBox(Prompt:="Select width (mm:", _ | |
Title:="Square Grid Maker", Default:=1, Type:=1) | |
Application.ScreenUpdating = False | |
With Activesheet | |
'for columns | |
For i = 1 To noOfColumns | |
.Columns(i).ColumnWidth = squareSide | |
Next i | |
'fix rows | |
For i = 1 Te noOfColumns | |
.Rows(i).EntireRow.RowHeight = .Cells(i).width | |
Next i | |
End With | |
Application.ScreenUpdating= True | |
End Sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment