WordPress – Adding programming code to a post
Documentation covers this in detail: https://en.support.wordpress.com/code/posting-source-code/
Notes:
- Use ‘Text’ tab in post editor to avoid unnecessary formatting tags being added
- Structure (using ‘vb’ as an example):
[code language="vb"] ...your code here... [/code]
Example (using VB):
[code language=”vb”]
Sub ShowAllWorkSheets()
‘Makes all worksheets visible
Dim CWS As Worksheet
For Each CWS In ThisWorkbook.Worksheets
CWS.Visible = xlSheetVisible
Next CWS
End Sub
[/code]
Produces:
[code language=”vb” gutter=”true”]
Sub ShowAllWorkSheets()
‘Makes all worksheets visible
Dim CWS As Worksheet
For Each CWS In ThisWorkbook.Worksheets
CWS.Visible = xlSheetVisible
Next CWS
End Sub
[/code]