wongsh
07-26-2016, 01:19 AM
Hey guys,
I am trying to write a program to copy an entire row and paste it to the next (Consists of values and formulas).
This action will need to be repeated on subsequent rows, and the number of times to repeat will be the number of non-blank cells in Column B under another Sheet2. Can anyone let me know what is the problem with my program below? Thanks!
Rows(3).EntireRow.Copy
Range("A3").Select
Dim k As Long
With Range("A:A")
For k = 1 To Worksheets("Sheet2").Range("B:B").Cells.SpecialCells(xlCellTypeConstants).Count
ActiveCell.Offset(1).Select
ActiveCell.Paste
Next k
End With
I am trying to write a program to copy an entire row and paste it to the next (Consists of values and formulas).
This action will need to be repeated on subsequent rows, and the number of times to repeat will be the number of non-blank cells in Column B under another Sheet2. Can anyone let me know what is the problem with my program below? Thanks!
Rows(3).EntireRow.Copy
Range("A3").Select
Dim k As Long
With Range("A:A")
For k = 1 To Worksheets("Sheet2").Range("B:B").Cells.SpecialCells(xlCellTypeConstants).Count
ActiveCell.Offset(1).Select
ActiveCell.Paste
Next k
End With