Variable Incrementing

J

John

I have a 500+ row 5 column worksheet IN with each line incrementing by 1 i.e
5 rows by 5 columns would appear
1 21 31 41 51
9 22 32 42 52
66 98 11 86 8
88 9 32 42 52
.. . . .
.. . . .
.. . . .
I need to link each of these rows to worksheet OUT whose rows that do not
increment by 1 but with 2 to 5 verticle rows between liked numbers i.e.

OUT with correct mapping would look like

Col1 A B C D E F
All
................ 1 21 31 41 51
................ 9 22 32 42 52
Malignant
neoplasms
Type A
Version B
.............. 66 98 11 86 8
.............. 88 9 32 42 52

Numbers will alway apear after the ........ in the order they appear on the
IN
worksheet.


How can I link uniformly list IN rows to nonuniformly spaced OUT rows.

Thanks ahead of time,

John (e-mail address removed)
 
M

mrice

Not sure that I fully understand the question...

Is it not just a case of setting up simple = formulae on your out
sheet at the point of your choosing?
 
J

John

True for short output sheets. One just types each row.
If the out :In sheet's rows are verticle increments are 1:1 the link of
row 1 can be cut and pasted to many (not all in this case do to headers) In
summary In:rout row increments of 1:1 are easy.

I have 2000+ lines of single spaced input data. It has to to be linked to
the 3000+ line Out sheet . Each 2 row set is spaced 1:2 or 1:3 or 1:5 1:2
up to 1:6 with no pattern.
(See snippet below) One would have to type ~1000 rows of links
delineating which NON 1:1 rows to link.
Any typing error can propagate to all following rows

The dots ..... uniquely show the lines needing data.
Something like If Trim ( Out:A1,5) = "....." get the correct In row.

By getting the # of rows between the 2nd row ...... and the NEXT first
......
the variable row increment can be determined. I'm not sufficiently fluent
in VBA to write this.
There may be better approaches to this.

The data in IN A1:E1 maps to Out C1:G1

Thanks in advance,
John



-- single row spaced In data that has to be linked to the
to the 3000 lines
 
M

mrice

This macro should help

Sub Populate()
Sheets("OUT").Select
Counter = 0
For N = 1 To Cells(65536, 1).End(xlUp).Row
If Cells(N, 1) = "……." Then
Counter = Counter + 1
Cells(N, 2) = Sheets("IN").Cells(Counter, 1)
End If
Next N
End Sub

I've assumed that the data in the IN sheet is in column A and also for
the OUT sheet.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top