excel - Are nexted loops possible in this form? -


i've spent couple days trying work 1 out. i'm trying take date (current_date) , compare list (around 150 values, grd dates), should return number current date greater than. should printed. once done current date moves next date , whole process repeats.

sub grd()  dim current_date long dim grd_count long dim count long dim g long dim grd_end_date long  grd_count = 0 count = 10 g = 10  until worksheets("abc").cells(count, 14).value = ""      current_date = worksheets("abc").cells(count, 14).value          until worksheets("abc").cells(g, 3).value = ""              grd_end_date = worksheets("abc").cells(g, 9).value                  if current_date > grd_end_date                     grd_count = grd_count + 1                  else: grd_count = grd_count                  end if               g = g + 1           loop      worksheets("abc").cells(count, 16).value = grd_count     count = count + 1 loop    end sub 

it giveing me values of 1 dates, though should value first current_date only.

does have ideas?

from i'm seeing don't reset grd_count each iteration, init before starting loop, , inside loops, either increment 1, when curr_date > grd_end_date, or keep same otherwise (which redundent nevermind now). try adding grd_count = 0 after printing before loop next row.


Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -