Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Setting page breaks within VBA for Excel

Status
Not open for further replies.

zaydy

Electrical
Sep 17, 2005
1
I am trying to set a horizontal page break within a large VBA program (more than 100 pages of macros). The code I am using is:

Cells(x,1).Select
ActiveWindow.SelectedSheets.HPageBreaks.Add Before:= ActiveCell

This does not work in my Excel program, but if I run the page break macro on another Excel workbook, it seems to run OK.

I must be doing something wrong, but I haven't got a clue as to what it is.

I will greatly appreciate any feedback on this issue.

I am running Excel 97 on a PC running Windows XT. (I will be changing to the most recent version of Excel. This raises a separate question of available literature on differences between VBA for Excel 97 and VBA for the latest version of Excel.

Zaydy
 
Replies continue below

Recommended for you

I am having the same problem. I went to and found thread68-805148. (Advanced Search page break then open the first thread which then links to the thread I have noted). I have not tried it yet but good luck to you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor