View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Beth Beth is offline
external usenet poster
 
Posts: 67
Default Macro to fill column with SUMPRODUCT formula

Hi,

I'm new to macros. How do I create a macro that sorts by Column A, inserts
two new columns after column B (i.e. they will become column C & D) and fill
column C & Column D with these formulas down to the last row in the current
sheet ?

Formula assumes that column headers are in first row.

Column C: =IF(SUMPRODUCT((A$2:A2=A2)+0,(B$2:B2=B2)+0)=1,"Exi st","Duplicate")

Column D:
=SUMPRODUCT(($A$2:$A$2=A2)*($C$2:$C$2="Exist"))

This will really save me time since I have to do this task on many sheets.

TIA

Beth