To insert the given row number for the corresponding row

bluue s
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

1 Header 1 Header 2 Header 3 ...........  Indicate row number
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
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Martin LissOlder 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?

Author

Commented:
Hi please see my edited question where i have uploaded the file. Thks !
Excel & VBA Expert
Most Valuable Expert 2018
Awarded 2015
Commented:
Please try this...
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

Open in new window

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

Author

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

Commented:
You're welcome!

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial