Re: $$Excel-Macros$$ How to keep variables constant in a procedure

2015-11-06 Thread Victor Wang
Thank you. Yes, I think adding .Value should solve the problem. Now VBA is referencing the value from that cell. Adding .Value should allow it to take the value only and will not change as the value in the cell changes. Just like a paste special value. I will test it at the lab next Mo

Re: $$Excel-Macros$$ How to keep variables constant in a procedure

2015-11-06 Thread Paul Schreiner
The problem is:You should use: Option Explicit at the beginning of each code module(you can make it automatic by selecting Tools->Options and Select "Require Variable Declaration") If you did that, you'd see that you are declaring Num_Sell as an integer. but then you're defining DIM_Sell as a RANG