Hello,

I'm making a table of contents, and I would like to make a macro that would insert the page number of where a criteria is met.

i.e: If the criteria (Cell A130 = B131) is met, the page number of where that criteria was met will be displayed as text in cell H6 for example. I already have the macro written for the whole table of contents and such. I'm just trying to look for/figure out what function/terminology is used for that instance (basically something along the lines of; if A130 = B131, then H6 = CurrentPage.InsertPageNumber, which of course isn't the right formatting)

Thank you all!