Thread: REPEAT NTH ROWS
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Junior728 Junior728 is offline
external usenet poster
 
Posts: 44
Default REPEAT NTH ROWS

Hi,

I wish to prompt the user for 2 parameters(M, N) inputs for every 26th row.
This is what i have in my macro but somehow it does not work. Is there any
problem with my coding?

E.g.

Sub Testing( )

M$ = InputBox("RMANO") 'Prompt user for Input
N$ = InputBox("ACCT") 'Prompt user for Input

Dim LstRow As Integer
Dim NwRow As Integer
Dim NthRow As Integer

'To Repeat This every 26 lines from currentrow
NthRow = 25
LstRow = Cells.SpecialCells(xlLastCell).Row

Do Until ActiveCell.Row LstRow
ActiveCell = Cells(3, 14).Select
ActiveCell.Offset(NwRow, 0).Select
M$ = Cells(3, 14).value 'First parameter in Column M,
N$ = Cells(3, 11).value Second parameter in Column N
NwRow = NwRow + 1
ActiveCell.Offset(NthRow - 1, 0).Select
Loop

End Sub