You are on page 1of 3

reverse the order of worksheet tabs

1. Hold down the ALT + F11 keys, and it opens the Microsoft Visual Basic for
Applications window.
2. Click Insert > Module, and paste the following code in the Module Window.
VBA code: Reverse the order of the worksheets

1
2
3
4
5
6
7
8

Sub ReverseSheets()
'Update 20140526
Dim xCount As Integer
xCount = Application.ActiveWorkbook.Worksheets.Count
For i = 1 To xCount - 1
Application.Worksheets(1).Move After:=Application.Worksheets(xCount - i + 1)
Next
End Sub

3. Then press F5 key to run this code, and the order of all worksheet tabs will be reversed
immediately.
Tip: Press the F5 key again, all worksheet will be ordered with the original order.

" Privacy Warning:this document contains macros,ActiveX controls,XML


expansion pack information or web components. these may include personal
information that cannot be removed by the document Inspector."
File
Options
Trust Center
Trust Center Settings
and when I clicked on the Document Inspector button, it told me that it couldn't
inspect the workbook because I had a Protected worksheet. Upon revising the
protection of each of the worksheets, i did find one, unprotected it, and Voila!,
problem solved.
OR
assign a button to this code & click on the button to save..
Sub try()
Application.DisplayAlerts = False

ActiveWorkbook.Save
Application.DisplayAlerts = True
End Sub

OR
For Excel 2007 Version :
You can follow the following steps to avoide the privacy warning.
1 Menu Button "on the top left of the excel window"
2 Excel Option
3 Trust Center
4 Trust Center setting
5 Privacy Options
6 unmark the "Remove personal information from file properties on save"
OR
In the workbook module add the following and it will save like normal without
using special buttons.
Technically I didn't have to use the "With" and the "."s but this is better.......
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
With Application
.DisplayAlerts = False
.EnableEvents = False
ThisWorkbook.Save
Cancel = True
.EnableEvents = True
.DisplayAlerts = True
End With
End Sub

The previous code over rode the Save As box. Use this instead
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
With Application
.DisplayAlerts = False
.EnableEvents = False
If SaveAsUI Then
Application.Dialogs(xlDialogSaveAs).Show
Else
ThisWorkbook.Save
End If
Cancel = True
.EnableEvents = True
.DisplayAlerts = True
End With
End Sub

Cannot move sheet to another excel workbook


Save from .xlsx to .xls (excel 97-2003)

Cannot insert any more Rows or Columns


The sheet is full, you must delete some rows / columns.
To permanently delete them select the row/column from where you want to
delete and press CTRL + SHIFT and arrows. Then press ALT+E, A, A. (old menu
from office 2003).

Wrap text always on or doesnt work


1. Wrap text doesnt work if the row is set to a specific height. Go to Home tab
-> Cells group (right) -> Format button -> AutoFit Row Height.
2. Wrap text doesnt work for merged cells ("You cannot use the AutoFit feature
for rows or columns that contain merged cells in Excel"). Wrap is related to
Autofit. Some single cells may be considered merged by themselves even if Excel
doesnt show them as merged. So you firstly must unmerge the cells.

You might also like