Hey guys.
I'm fairly new to VBA. I recently created a macro that extracts data and puts it into a new spreadsheet. Now it works fairly well, and today I tried it on a sheet with thousands of rows of data. There are two adjacent columns in the spreadsheet for which there are numbers in each column. A debit and credit column. If you aren't familiar, basically all the numbers that appear in the debit column should be in the credit column as well and in the end the sums of each column should match up. Now my macro takes all the numbers from each column and puts them all in a single column and assigns it as a positive number if its from debit and negative if its from credit. It's obvious that the sum of that column should be 0 at as well since all the postivie and negative numbers should cancel out. However for some reason my macro missed out on a single cell from the credit column which gave me a discrepancy. The same number from the debit column was copied but not from the credit column. Now there will never be two adjacent cells filled with numbers, they will always either both be blank or only one of the debit or the credit column will have a number. This is the portion of the code that handles what to do.
I'm confused why it just missed out on a single cell of data. The columns basically looked like this but with hundreds of rows of data:
Bookmarks