ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   excel macro (https://www.excelbanter.com/excel-programming/314847-excel-macro.html)

yankeefan

excel macro
 
I need to do the following inside an excel macro. I will insert some
information on row 2 of a spreadsheet. I need that row copied and pasted on
all even rows of that spreadsheet until the end of the recordset, starting
on row 4. Can anyone help with the code?



yankeefan

excel macro
 
Anyone? Please? :)

"yankeefan" wrote in message
m...
I need to do the following inside an excel macro. I will insert some
information on row 2 of a spreadsheet. I need that row copied and pasted
on all even rows of that spreadsheet until the end of the recordset,
starting on row 4. Can anyone help with the code?




Dave Peterson[_3_]

excel macro
 
I don't know how you determine the lastrow or what you mean by record set, but
maybe this will help:

Option Explicit
Sub testme01()

Dim myRow As Range
Dim iRow As Long

With ActiveSheet
Set myRow = .Rows(2)
For iRow = 4 To 2000 Step 2
myRow.Copy _
Destination:=.Rows(iRow)
Next iRow
End With

End Sub




yankeefan wrote:

I need to do the following inside an excel macro. I will insert some
information on row 2 of a spreadsheet. I need that row copied and pasted on
all even rows of that spreadsheet until the end of the recordset, starting
on row 4. Can anyone help with the code?


--

Dave Peterson



All times are GMT +1. The time now is 02:34 AM.

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