PDA

View Full Version : Solved: Copy Data Without Cell Borders



bopo
03-03-2008, 01:18 PM
Hi

I wrote a little method which copies values from one sheet to another, however it also copies each cells border which makes the new spreadsheet look ugly, just wondering if there is a method of avoiding copying the borders.

Below is my code


Sub ReportSub()
Dim SelRG As Range, RW As Range

Set SelRG = Intersect(Selection.EntireRow, Selection.Worksheet.Columns("A:L"))

For Each RW In SelRG.Rows 'loop through each 'row' (cols A:K) of selection
With Sheets("PrintRecord") 'destination sheet
RW.Cells(1).Copy .Range("C8")
RW.Cells(2).Copy .Range("C12")
RW.Cells(3).Copy .Range("C13")
RW.Cells(4).Copy .Range("C14")
RW.Cells(5).Copy .Range("C15")
RW.Cells(6).Copy .Range("E12")
RW.Cells(7).Copy .Range("E13")
RW.Cells(8).Copy .Range("E14")
RW.Cells(9).Copy .Range("C22")
RW.Cells(10).Copy .Range("D22")
RW.Cells(11).Copy .Range("E22")
' RW.Cells(11).Copy .Range("C37")

End With
Next
Sheets("PrintRecord").Select
End Sub


Help appreciated

allison
03-03-2008, 01:45 PM
I used this:
SrcBook.Worksheets(2).Range("Name").Copy
DestBook.Worksheets(1).Range("A" & FinalRow + 1).PasteSpecial Paste:=xlPasteValues

bopo
03-03-2008, 02:55 PM
That looks great, thanks!