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

PHPMotion implementation - URL based videos (Hosted on separate location) -

c# - Unity IoC Lifetime per HttpRequest for UserStore -

I am trying to solve the error message 'incompatible ranks 0 and 1 in assignment' in a fortran 95 program. -