View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
gerdmain gerdmain is offline
external usenet poster
 
Posts: 13
Default copy and insert cells with macro

Hi Tim,

Most of the required code can be produced by simply recording a macro. Pick
any row you like (say row 8) and perform the actions, i.e. select F:R, copy,
switch sheets, insert row, paste values and copy the formats from the row
below

The code recorded will then be specific for row 8, e.g. Range("F8:R8").Select

Once you have this, post the code and someone will show you how to go
through the rows and find the "1"s and change the Range accordingly.


--
Gerd


"Tim" wrote:

Hi All,

On Sheet1 is a range F1:R500. In some of the cells in column R is number
1. What I need is to create a macro which will do the next: for every row
in range F1:R500 if the cell in column R is 1, copy cells F:R, then go to
Sheet2, insert a row, paste copied VALUES from Sheet1 in cell F1 of Sheet2
and copy the formulas from G2:L2 to G1:L1 of the same worksheet.
Any Help is highly appreciated.

Tim