# To insert the given row number for the corresponding row

bluue s used Ask the Experts™
on
I have set of numbers that indicate row numbers.
How do i set a indicator in excel to identify the row numbers?

Set of row numbers:

Points outside
6
18
60
71
201
266

2 ------
3........
4........
5........
6........
7......                                                                1

NOTE: observe that 6 is at the 7th row as header is = row 1.
Same concept apply to the rest of the numbers.

Thus to do a macro base to indicate the row number given whatever number stated in the file.

See attached.
Row-Indicator.xlsx
Comment
Watch Question

Do more with

EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Older than dirt
Most Valuable Expert 2017
Distinguished Expert 2018

Commented:
Can you attach a workbook that shows at least some of the data and what you would like to see after the macro runs?

Commented:
Hi please see my edited question where i have uploaded the file. Thks !
Excel & VBA Expert
Most Valuable Expert 2018
Awarded 2015
Commented:
``````Sub RowIndicator()
Dim lr As Long, i As Long
Dim x, y()
lr = Cells(Rows.Count, 1).End(xlUp).Row
x = Range("A2:C" & lr).Value
ReDim y(1 To lr, 1 To 1)
For i = 1 To UBound(x, 1)
If x(i, 3) <> "" And x(i, 1) <> "" Then
y(x(i, 3), 1) = 1
End If
Next i
Range("D2").Resize(lr - 1).Value = y
End Sub
``````
In the attached, click the button called "Row Indicator" to run the code and see if this is what you are trying to achieve.
Row-Indicator.xlsm

Commented:
Thanks Subodh for the prompt and accurate solution that i need!
Excel & VBA Expert
Most Valuable Expert 2018
Awarded 2015

Commented:
You're welcome!

Do more with