bgarcia94550
Technical User
I have the following code to copy a row that is not hidden , then pasted to another sheet in the same workbook. The problem I have is that the formatting is all gone in the destination sheet. Here's my code:
Sub CopyLine2()
Dim Boxsize As Integer
Dim Row As Integer
Dim Rownum As Integer
Rownum = 0
Worksheets("Price Card").Activate
Boxsize = Worksheets("Price Card").UsedRange.Rows.Count
For Row = 1 To Boxsize
If Rows(Row).Hidden = False Then
Rownum = Rownum + 1
Rows(Row).Select
Selection.Copy
'Destination sheet
Worksheets("Price2").Select
Rows(Rownum).Select
ActiveSheet.Paste
Application.CutCopyMode = False
Worksheets("Price Card").Activate
End If
Next Row
End Sub
Sub CopyLine2()
Dim Boxsize As Integer
Dim Row As Integer
Dim Rownum As Integer
Rownum = 0
Worksheets("Price Card").Activate
Boxsize = Worksheets("Price Card").UsedRange.Rows.Count
For Row = 1 To Boxsize
If Rows(Row).Hidden = False Then
Rownum = Rownum + 1
Rows(Row).Select
Selection.Copy
'Destination sheet
Worksheets("Price2").Select
Rows(Rownum).Select
ActiveSheet.Paste
Application.CutCopyMode = False
Worksheets("Price Card").Activate
End If
Next Row
End Sub