How to number all pages in all the worksheets continuously from 1.

M

M P Gupta

I want that my workbook numbers from 1 onwards till the last page of the last
worksheet. I don't want each worksheet to start numbering from page no.1.
Please suggest a way for this.
 
S

Susan

well, you could do it manually, but it's very tedious.
sheet1 cell A1 enter "1"
sheet2 cell A1 enter "=sheet1!A1+1"
sheet3 cell A1 enter "=sheet2!A1+1"

very tedious but works.
you could also write a macro to do it all at once.

Option Explicit

Sub increase_numbering()

Dim ws As Worksheet
Dim i As Integer
Dim r As Range

For Each ws In ActiveWorkbook.Worksheets
Set r = ws.Range("A1")

If ws.Name = "Sheet1" Then
r.Value = 1
i = 1
End If

If ws.Name <> "Sheet1" Then
r.Value = i + 1
End If
Next ws

End Sub

hope that helps!
:) susan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top