Blog

How set all cells size and formatting back to default


res

VBA code to set all column/row’s size back to default size, and Remove all cells formatting and styles.

Sub resetcells()

ActiveSheet.Cells.ClearFormats
ActiveSheet.Rows.EntireRow.RowHeight = ActiveSheet.StandardHeight
ActiveSheet.Columns.EntireColumn.ColumnWidth = ActiveSheet.StandardWidth

ActiveSheet.Cells.Font.Name = Application.StandardFont

End Sub

View original post

How add color button to excel sheet and assign macro to it.

First click on Insert tab in excel menu then choose Illustrations, then click on Shapes.

Choose any shape you like to put as button, for example: rectangle or oval.

You can Choose any color for your button from Shape Fill tab, also you can choose effects for button by clicking on Shape Effects.

Press mouse right click on the button an choose Edit Text to enter text to button, also another right click on button and choose Assign Macro, and choose macro you want to run by this button.

How set all cells size and formatting back to default

res

VBA code to set all column/row’s size back to default size, and Remove all cells formatting and styles.

Sub resetcells()

ActiveSheet.Cells.ClearFormats
ActiveSheet.Rows.EntireRow.RowHeight = ActiveSheet.StandardHeight
ActiveSheet.Columns.EntireColumn.ColumnWidth = ActiveSheet.StandardWidth

ActiveSheet.Cells.Font.Name = Application.StandardFont

End Sub

First blog post

VBA (Visual Basic for Applications) is the programming language of Excel and other Office programs.

You can make many useful program by:

1- Create a Macro: With Excel VBA you can automate tasks in Excel by writing macros.

2- MsgBox: The MsgBox is a dialog box in Excel VBA you can use to inform the users of your program.

3- User form: make user do his work easily by using forms.