Open a Workbook to a Specific Sheet

Sometimes you need to open your workbook be started on a specific worksheet. With this macro, if a user is working with your workbook, they can’t go astray because the workbook starts on the exact worksheet it needs to. Macro Code Private Sub Workbook_Open() ‘Step 1: Select the specified sheet…

Unprotect a Worksheet on Workbook Open

Sometimes you need to unprotect the worksheets in a workbook before continuing your work. If you find that you’re constantly unprotecting worksheets, this macro maybe help you. Macro Code Private Sub Workbook_Open() ‘Step 1: unprotect the sheet with a password Sheets(“Sheet1″).Unprotect Password:=”ExcelHowTo” End Sub How This Macro Works This code…

Protect a Worksheet Before Workbook Close

Sometimes you need to send your workbook out into the world with specific worksheets protected. If you find that you’re constantly protecting and unprotecting sheets before distributing your work-books, this macro can help you. Macro Code Private Sub Workbook_BeforeClose(Cancel As Boolean) ‘Step 1: Protect the sheet with a password Sheets(“Sheet1”).Protect…

Auto Save a Workbook Before Closing

This macro is an excellent way to protect users from inadvertently closing their file before saving. When implemented, this macro ensures that Excel automatically saves before closing the workbook. Excel normally warns users who are attempting to close an unsaved workbook, giving them an option to save before closing. However,…

Saving a Workbook When a Specific Cell Is Changed

Sometimes, you may want to save a workbook when a specific cell is changed or range of cells is changed. This macro allows you to define the range of cells that, when changed, forces the workbook to save. Macro Code to Saving a Workbook When a Specific Cell Is Changed Private…

Creating a New Workbook Using Macro

Perhaps you may need to create a new workbook in an automated way. For example, you may want to copy data from a table and paste it into a newly created workbook. The below macro copies a range of cells from the active sheet and pastes the data into a…

REPT function

Description REPT function repeats a piece of text a specified number of times. Use REPT to fill a cell with a number of instances of a text string. Syntax REPT(text,number_times) Parameters text: is the character or string you want to repeat number_times: is the number of times to repeat text Remarks If number_times…

How To Create Sparklines Use Excel Functions

Sparklines is new in Microsoft Excel 2010, a sparkline is a tiny chart in a worksheet cell that provides a visual representation of data. This tutorial helps you how to create Sparklines use Excel Functions. Note: this tutorial works well in excel 2003, 2007, 2010, 2013. What is Sparklines? A sparkline is a very…