Forum Discussion

shahzad_afzal_pk's avatar
shahzad_afzal_pk
Copper Contributor
Nov 13, 2022

Find last occurrence

Dear.

I need to have a VBA Script to find last occurrence date of value in excel... I have list of items in Column H and have generated a list of unique from that in column M... Date column in B...

I want to fetch last occurrence date of the items in Column M in column N please...

6 Replies

    • shahzad_afzal_pk's avatar
      shahzad_afzal_pk
      Copper Contributor
      Hi;
      Just wanted to represent my scenario... I have a sorted list of unique from a column (Column M), I want to display last billed date of after matching from the column of data (Column M to Column H) with the date column (Column B)...
      Column H has the data from which i have created the column M...

      Attached sheet is just giving today's date after any input of data...
  • shahzad_afzal_pk 

    No doubt you do need a VBA solution but I am curious to know why when there are simple worksheet formulas available to perform the same task.

    = XLOOKUP(distinctItems, sales[Items],sales[Dates],"",0,-1)

     

    • shahzad_afzal_pk's avatar
      shahzad_afzal_pk
      Copper Contributor
      Hi;
      I have all lookup and related formulas in the sheet... Due to huge data, sheet is now touching 28MB... Need to migrate to VBA to improve sheet calculation time...

Resources