For Loops not running inside If statement Excel VBA -


i'm writing code update inventory spreadsheet on first of every month. have little knowledge of vba understand basics of programming. please excuse poor code.

the problem after initial if statement check, when true runs line directly below (adding new line) , not execute loops after edit data.

sub auto_open() dim stock(21)    if date - day(date) + 1 = date  range("'monthly office inventory'!a2").entirerow.insert  = 0 21 stock(i) = range("current office inventory'!a2").offset(0, i).value next  x = 0 21 range("'monthly office inventory'!b14").offset(0, x).value = stock(x) next x  end if  end sub 

probably easiest way changing condition to:

if day(date) = 1 then

now, i'm writting on mac, think you'll idea (and correct if detail wrong).


Comments

Popular posts from this blog

php - How to serve a file for download on WordPress -

how to share virtual sharepoint server and get it in host windows and visual studio? -