count of instances

scorpweb

Board Regular
Joined
Jul 26, 2011
Messages
124
hey all,

I have a spreadsheet xreferencing possibilities of duplicates below the entry and specifies how many rows below it the duplicate is. (i.e. 7 = duplicate is 7 rows below)

these can be multiple occurrences such as


Subject 1 ----- 1/aug/14 -----14/aug/14 -----7
7 rows below....
Subject 1 ----- 1/aug/14 -----14/aug/14 -----2
2 rows below
Subject 1 ----- 1/aug/14 -----14/aug/14 -----0

I need a way to log in excel these instances.

I am thinking maybe a "do until" using a variable as the duplicate row value but i can't figure out how to get it past 2 entries.

the entries will be called later as cell comment (have this sorted and not a problem) it's more just i need to specify the rows to call the data in the comment.

not wrote much code for it yet as just looking for a bit of guidance with how to proceed with this.

any ideas what would be best.
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
" log in excel these instances." what is meant by this

suppose data is like this

hdng1
1
2
7
6
5
4
3
2
7
5
4
3
7

<tbody>
</tbody>





try this macro. 7s will be colored yellow except first 7

Code:
Sub test()
Dim x As Integer, cfind As Range, add As String
x = 7
Columns("A").Cells.Interior.ColorIndex = xlNone
Set cfind = Columns("A:A").Cells.Find(what:=x, lookat:=xlWhole)
If Not cfind Is Nothing Then
add = cfind.Address
End If
Do
Set cfind = Columns("A").Cells.FindNext(cfind)
If cfind Is Nothing Then Exit Do
If cfind.Address = add Then Exit Do


cfind.Interior.ColorIndex = 6
Loop


End Sub
 
Upvote 0

Forum statistics

Threads
1,214,534
Messages
6,120,084
Members
448,943
Latest member
sharmarick

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top