VBA macro Error 6 overflow -


so i've been doing reading overflow error, , updated of integers using longs. i'm still having issues error though. excel macro glorified copy, looping through 2 tables combine costs matching values.

sub moveactual() 'speed macro section application.calculation = xlcalculationmanual application.screenupdating = false  dim long 'row in fcstall dim j long 'row in gl - actuals dim fcstall worksheet dim glactuals worksheet dim failedcopy boolean  set fcstall = sheets("forecast all") set glactuals = sheets("gl - actuals all") j = 2 'initialize gl - actuals loop  while glactuals.cells(j, 2).value <> "" 'loop through gl      = 3 'initialize forecast loop     failedcopy = true 'initialize copy check      while fcstall.cells(i, 2).value <> "" 'loop through fcst          'find match between fcst , gl         if ((glactuals.cells(j, 2).value = fcstall.cells(i, 2).value , _              glactuals.cells(j, 3).value = fcstall.cells(i, 3).value) , _              not (glactuals.cells(j, 17).value = "found"))               'copy on actual             fcstall.range(fcstall.cells(i, 22), fcstall.cells(i, 33)).value = _              glactuals.range(glactuals.cells(j, 5), glactuals.cells(j, 16)).value              failedcopy = false             glactuals.cells(j, 17).value = "found"          end if         = + 1    'incriment continue loop       loop      if failedcopy          'copy on details         fcstall.range(fcstall.cells(i, 1), fcstall.cells(i, 3)).value = _            glactuals.range(glactuals.cells(j, 1), glactuals.cells(j, 3)).value          fcstall.cells(i, 4).value = "gl - actuals all"         fcstall.range(fcstall.cells(i, 5), fcstall.cells(i, 22)).value = 0         'copy on missing finance data         fcstall.range(fcstall.cells(i, 22), fcstall.cells(i, 33)).value = _            glactuals.range(glactuals.cells(j, 5), glactuals.cells(j, 16)).value       end if     j = j + 1   'incriment j continue loop  loop  'restart processes application.calculation = xlcalculationautomatic application.screenupdating = true   end sub 

the code breaks when = 709 , j = 464 during 'find match between fcst , gl if statement.

any second eyes on appreciated, i'm missing small can't find it.


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -