ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Setting up and Configuration of Excel (https://www.excelbanter.com/setting-up-configuration-excel/)
-   -   Paste rows in macro (https://www.excelbanter.com/setting-up-configuration-excel/199559-paste-rows-macro.html)

murphy

Paste rows in macro
 
I need to copy and paste rows using macro. Column P has a number in it. That
is the number that I want to copy rows.

Gord Dibben

Paste rows in macro
 
Sub copy()
Dim pnum As Integer
pnum = Range("P1").Value
ActiveCell.Resize(pnum, 12).copy Destination:=Sheets(2).Range("A1")
End Sub


Gord Dibben MS Excel MVP

On Wed, 20 Aug 2008 13:22:26 -0700, murphy
wrote:

I need to copy and paste rows using macro. Column P has a number in it. That
is the number that I want to copy rows.




All times are GMT +1. The time now is 02:13 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com