how to give pagenumber in cell calc libre

asked 2016-01-18 23:18:26 +0100

gliva gravatar image

updated 2016-03-09 21:08:50 +0100

Alex Kemp gravatar image

I try with macro from http://www.excelforum.com/excel-gener...

Sub pagenumbers() Dim MyR As Range Dim PageNumber As Long

Set Mysheet = ActiveSheet PageNumber = 1 Set MyR = Range("A1") ' starting cell MyR.Value = "Page " & PageNumber ' first page number

Do While Not Intersect(MyR, ActiveSheet.UsedRange) Is Nothing If MyR.EntireRow.PageBreak = xlPageBreakAutomatic Then MyR.Value = "Page " & PageNumber ' put page number in cell PageNumber = PageNumber + 1 End If Set MyR = MyR.Offset(1, 0) ' move down Loop End Sub

it said Range is unknown dataype. Do you have any ideas to add page number in cell, because page number is in header. Thx

edit retag flag offensive close merge delete