Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
DJH DJH is offline
external usenet poster
 
Posts: 14
Default Excel97 - Syntax for Find, Offset, Insert Page

Within an Excel 97 sheet, I want to find all occurrences of a certain string
text. From each of these cells, I need to go down one row and left one cell,
and insert a page break. I am having trouble with the syntax to accomplish
this, particularly with what is needed to position me at the desired point
for the page insert.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Excel97 - Syntax for Find, Offset, Insert Page

Dim rng as Range
set rng = cells.Find("StringTarget")
if not rng is nothing then
sAddr = rng.Address
do
Activesheet.HPageBreaks.Add rng.offset(1,-1)
set rng = cells.findnext(rng)
loop while rng.Address < sAddr

Adjust to suit

--
Regards,
Tom Ogilvy


"djh" wrote in message
...
Within an Excel 97 sheet, I want to find all occurrences of a certain

string
text. From each of these cells, I need to go down one row and left one

cell,
and insert a page break. I am having trouble with the syntax to

accomplish
this, particularly with what is needed to position me at the desired point
for the page insert.



  #3   Report Post  
Posted to microsoft.public.excel.programming
DJH DJH is offline
external usenet poster
 
Posts: 14
Default Excel97 - Syntax for Find, Offset, Insert Page

Tom,
Thank you very much. That was just what I needed to get me started on my
macros.
Debbie

"Tom Ogilvy" wrote:

Dim rng as Range
set rng = cells.Find("StringTarget")
if not rng is nothing then
sAddr = rng.Address
do
Activesheet.HPageBreaks.Add rng.offset(1,-1)
set rng = cells.findnext(rng)
loop while rng.Address < sAddr

Adjust to suit

--
Regards,
Tom Ogilvy


"djh" wrote in message
...
Within an Excel 97 sheet, I want to find all occurrences of a certain

string
text. From each of these cells, I need to go down one row and left one

cell,
and insert a page break. I am having trouble with the syntax to

accomplish
this, particularly with what is needed to position me at the desired point
for the page insert.




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Insert more than 1 Row Syntax blazzae Excel Worksheet Functions 5 July 10th 05 12:46 AM
MS Office Excel97: Removing Page Breaks W. Watson Excel Discussion (Misc queries) 2 April 15th 05 11:38 PM
excel97 vs excel2000 (Find instruction) cyrille New Users to Excel 4 March 4th 05 11:02 PM
excel97 vs excel2000 (Find instruction) cyrille Excel Worksheet Functions 0 February 25th 05 07:26 PM
OFFSET Syntax Scott1523[_2_] Excel Programming 2 August 5th 04 04:33 PM


All times are GMT +1. The time now is 02:53 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"