View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Chris Bromley Chris Bromley is offline
external usenet poster
 
Posts: 1
Default Dynamic copying & pasting of rows

Hi All,

I have a large number of Excel files in several folders that I need to
perform the following task in. I know how to write VBA code to move from file
to file in order to apply the task, but I cant figure out how to write a
program to do the task itself.

Each file contains three columns of coordinates (in columns A, B & C) , with
the headings X, Y & Z in row 1 of the three columns. The first few rows all
contain the number 5 in column B. I need to copy all of these rows and then
paste them starting in row 2 without overwriting any of the data in the
original rows, i.e. I need to insert a number of empty rows equal to the
number of copied rows starting in row 2. Finally, I need to change all the
fives in the PASTED data to zeros.

The problem is that the number of rows with 5 in column B varies from file
to file, and I cant figure out a way to deal with this variation in my code.

Any help would be greatly appreciated!

Many thanks,

Chris Bromley