break page

  • Thread starter Thread starter Mery
  • Start date Start date
M

Mery

Hi,
I have another problem,example the word 'signature' is always in the same
column but it changes row.
I wont to do a break page in the same row when the word 'signature' arise!
End last question is...how can I lock view code,that no one can use it!
Thanks in advance!
Mery
 
This code will insert a pagebreak below the word Signature in column A

Sub Insert_PBreak()
Dim OldVal As String
Dim rng As Range
OldVal = "Signature"
For Each rng In Range("A1:A300") '<< change range
If rng.text = OldVal Then
rng.Offset(1, 0).PageBreak = xlPageBreakManual
End If
Next rng
End Sub

Second problem..................

Open the VBE.

Select your workbook/project and right-click>myworkbook
properties>protection>lock project for viewing. Add a password and OK out.

Note: file must be saved, closed and re-opened before protection takes place.


Gord Dibben MS Excel MVP
 

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

Similar Threads

Set print area 3
Insert page break 3
Setting and removing page breaks 2
Newb: Asking about a tweak in code 2
Problem removing page break 5
variable page breaks 1
Controlling Page Break Preview 7
Page break code 2

Back
Top