Eric Zwiekhorst
asked on
Excel:after search insert pagebreak before active cell in visual basic
I would like to add a page break after I searched a cell with the search function.
I need to select the entire row to insert pagebreak but don't know how to do this when the only reference I have is the activecell.
I need to select the entire row to insert pagebreak but don't know how to do this when the only reference I have is the activecell.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
ActiveCell.Rows.Activate
ActiveWindow.SelectedSheet s.HPageBre aks.Add Before:=ActiveCell
this does the job, your's did add pagebreak but after the active cell??
ActiveWindow.SelectedSheet
this does the job, your's did add pagebreak but after the active cell??
sorry thought that was asked for
>>after I searched a cell
but clearly not ..... :)
>>after I searched a cell
but clearly not ..... :)
ASKER
I found a answer myself that works
ActiveCell.Rows.Activate
ActiveWindow.SelectedSheet
this does the job