smozgur
BatCoder
- Joined
- Feb 28, 2002
- Messages
- 2,659
Highlighting code snippets by using BB code helps separate the code from the actual question in the post content, and also makes the code more readable. Codes posted this way could be also copied easily by using the copy icon at the top right corner of the code area. Therefore we strongly recommend using BB code to highlight code snippets to make it as easy as you can for the volunteers who are trying to help you, and likely get faster replies.
To make the highlighting process easier, we implemented the single-click toolbar buttons when we migrated to the new forum software last year, <vba/> and <rich/>. You simply paste the code, select it in the editor, and click the corresponding button on the toolbar to wrap the code in the necessary tags.
We are happy to announce that we recently implemented syntax highlighters for Power Query M Code and Excel Functions, and also created dedicated icons for the languages that are mostly being used and placed the buttons on the post editor toolbar as shortcuts to make them easily accessible.
You can find the sample outputs below to see how it looks.
You can still post code in other languages such as HTML, JavaScript by using the </> button on the toolbar.
Please help the community members who are trying to answer your question, and try to use code tags to highlight your code snippets.
While you are checking the toolbar for these new buttons, please also look for the XL2BB button as the last one on the toolbar and also consider downloading free XL2BB add-in to post your sample Excel range which is also a great help to other members answering questions. Without exchanging workbook files, sample range posted by using XL2BB can be transferred to Excel easily that would save other members to create the same data structure in Excel manually.
Thank you!
To make the highlighting process easier, we implemented the single-click toolbar buttons when we migrated to the new forum software last year, <vba/> and <rich/>. You simply paste the code, select it in the editor, and click the corresponding button on the toolbar to wrap the code in the necessary tags.
We are happy to announce that we recently implemented syntax highlighters for Power Query M Code and Excel Functions, and also created dedicated icons for the languages that are mostly being used and placed the buttons on the post editor toolbar as shortcuts to make them easily accessible.
You can find the sample outputs below to see how it looks.
Excel Formula:
=VLOOKUP(A2,E2:I36,2,FALSE)
VBA Code:
Sub howManyRows()
Dim rng As Range
'Get the name range
Set rng = Sheet1.Range("Expenses")
MsgBox rng.Rows.Count, vbOKOnly + vbInformation, "Total Rows"
End Sub
Power Query:
let
// Get the table data
Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content]
in
Source
Python:
df = xl("A1:A6", headers=True)
df["Reversed"] = df.loc[:,"Original"].apply(lambda x: x[::-1])
df[["Reversed"]]
SQL:
SELECT ExerciseLog.LogDate, Sum(ExerciseLog.Calories) AS SumOfCalories
FROM ExerciseLog
GROUP BY ExerciseLog.LogDate;
Rich (BB code):
Sub howManyRows()
Dim rng As Range
Set rng = Sheet1.Range("Expenses")
MsgBox rng.Rows.Count, vbOKOnly + vbInformation, "Total Rows"
End Sub
You can still post code in other languages such as HTML, JavaScript by using the </> button on the toolbar.
Please help the community members who are trying to answer your question, and try to use code tags to highlight your code snippets.
While you are checking the toolbar for these new buttons, please also look for the XL2BB button as the last one on the toolbar and also consider downloading free XL2BB add-in to post your sample Excel range which is also a great help to other members answering questions. Without exchanging workbook files, sample range posted by using XL2BB can be transferred to Excel easily that would save other members to create the same data structure in Excel manually.
Thank you!