

Here, we insert VBA code to insert page breaks.Next, from the Insert tab, select Module.To do this, from the Developer tab → select Visual Basic.First, we bring up the VBA Module window, where we type our codes.Here, we will be using the For Next Loop to go through each cell. If yours is not, then you will need to sort the data to keep similar data together. This means we will insert a page break after Laptop, Smart Watch, and Fitness Tracker. In this section, we will insert a page break whenever there is a new cell value on our selected range. Using Excel VBA to Insert Page Break Based on New Cell Value Firstly, File → Options → Customize Ribbon tab → select Developer.ġ.

If it is not turned on, then you can turn it on simply by following these steps:

We have taken data from a retail electronics store to show price information for 3 types of products.īefore jumping on to the step-by-step guides, you need to make sure that the Developer tab is turned on in the Ribbon. We will slightly edit this data for each method. To demonstrate our methods, we have selected a dataset with 3 columns: “ Product”, “ Brand”, and “ Price”. 4 Handy Approaches to Insert Page Break Based on Cell Value with Excel VBA
