PDA

View Full Version : Loop based on count of serial number and fill formula



rajkumar
03-20-2018, 05:56 AM
hi,
i want to loop based on count of serial number in c column , say count of serial number in C2:C4 is 3 the i want to enter formula in L3 as = K4-K3

here i am skipping the first row of that serial number, similarly count of C5:C9 is 5 so i will skip L5 and in L6, formula will be =K6-K5

and so on. Similarly in M column also i wanted to enter formula =DATEDIF(H2,H3,"d") by skipping the first row of that serial number.

Now , this i wanted to do through a loop. please help to achieve this in vba since my list is very big.

i have attached a sample file

Regards21870
Rajkumar Rao.R