Paste values & formats
Sub CopyClosingData()
Dim i As Long, rng As Range, sh As Worksheet
Dim rng1 as Range
Worksheets.Add(After:=Worksheets( _
Worksheets.Count)).Name = "ClosingData"
Set sh = Worksheets("Closings")
i = 12
Do While Not IsEmpty(sh.Cells(i, 1))
Set rng = Union(sh.Cells(i, 1), _
sh.Cells(i + 1, 1).Resize(2, 1))
rng.EntireRow.Copy
set rng1 = Worksheets("ClosingData") _
.Cells(Rows.Count, 1).End(xlUp)(2)
rng1.PasteSpecial xlValues
rng1.PasteSpecial xlFormats
i = i + 12
Loop
End Sub
--
Regards,
Tom Ogilvy
"HJ" wrote in message
...
Can anyone tell me how/where I would add code to this macro to paste both
values and formats? TIA
Sub CopyClosingData()
Dim i As Long, rng As Range, sh As Worksheet
Worksheets.Add(After:=Worksheets( _
Worksheets.Count)).Name = "ClosingData"
Set sh = Worksheets("Closings")
i = 12
Do While Not IsEmpty(sh.Cells(i, 1))
Set rng = Union(sh.Cells(i, 1), _
sh.Cells(i + 1, 1).Resize(2, 1))
rng.EntireRow.Copy Destination:= _
Worksheets("ClosingData").Cells(Rows.Count, 1).End(xlUp)(2)
i = i + 12
Loop
End Sub
|