View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Help with dulicate range and highlight rows

Maybe this'll get you started:

Option Explicit
Sub testme01()

Dim iRow As Long
Dim FirstRow As Long
Dim LastRow As Long
Dim wks As Worksheet

Set wks = Worksheets("sheet1")

With wks
FirstRow = 2 'headers in row 1?
LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row

For iRow = LastRow To FirstRow Step -1
.Rows(iRow + 1).Insert
.Cells(iRow, "A").Range("a1:h1").Copy _
Destination:=.Cells(iRow + 1, "A")
.Cells(iRow + 1, "A").Range("a1:w1").Interior.ColorIndex = 3
Next iRow
End With

End Sub



ryanp wrote:

Hi,

My table has data from coluum A to W. I would like to duplicate the data in
coluum A to H. Each new row will be right below the original one. Then the
new rows will be hightlighted from coluum A to W.

I appreciate your help.


--

Dave Peterson