Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default REPEAT NTH ROWS

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
Cells(3, 14).Select
ActiveCell.Offset(NwRow, 0).Select
'If you want cell(3, 14) Or Range("N3") to equal the
'M$ value from the InputBox function then:

Cells(3, 14) = M$
'Same for N$:
Cells(3, 11) = N$ 'Only this puts it in Range("K3")
'Cells(3, 13) woud be Range("M3")

M$ = Cells(3, 14).value 'First parameter in Column M,
N$ = Cells(3, 11).value Second parameter in Column N

'Don't know what the NwRow means. There is no starting value.
NwRow = NwRow + 1

ActiveCell.Offset(NthRow - 1, 0).Select
Loop

End Sub


If you can think this over and repost with a more consitent
description of what you need, I'm sure we can fix you up. This
description and the sample code are a little confusing.




"Junior728" wrote:

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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I sum repeat rows? Marc Excel Worksheet Functions 2 October 16th 08 03:11 PM
printing issue - want to repeat two rows and also 5 rows in column cliffykat Excel Discussion (Misc queries) 0 August 29th 07 10:36 PM
how to repeat rows at the bottom while using the rows repeat at to Rows to repeat at the bottom Setting up and Configuration of Excel 1 August 31st 05 02:06 PM
Title Cut Off if Rows to Repeat & Columns to Repeat are Both Selec unibaby Excel Discussion (Misc queries) 2 August 24th 05 04:29 PM
Unable to select rows in the repeat rows on top option Noppie Excel Discussion (Misc queries) 2 December 28th 04 03:17 PM


All times are GMT +1. The time now is 01:42 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"