PDA

View Full Version : Autopopulating columns until one column reaches a certain value, then stopping



gratefulwork
09-24-2018, 10:39 PM
Hi,

I am a new VBA user, and I have run into a problem with my current project. I have 4 columns, 3 containing simple formulas.
In Excel, I would simply select these columns, and drag them down until the "Mortgage Balance" equals zero. I would then drag and select the data, so I could copy it.

What I want to do in VBA is to have a macro that automatically selects the first few rows and then drags the columns down so that they autopopulate until the "Mortgage Balance" column equals zero, and then stop. The formulas have different inputs, so the number of cells it takes for the "Mortgage Balance" to equal zero will vary. I would then like VBA to select all of the data so that I can then copy and paste it into another sheet. I wish I could post some code that I have already, but I am afraid I have nothing as I am so new to this.

I have a attached a simple picture of my worksheet for reference.

22923

Any insight or advice is greatly appreciated!

mancubus
09-25-2018, 12:22 AM
welcome to the forum.

rather than posting the SS of the sheet, post your workbook pls...

gratefulwork
09-25-2018, 09:04 AM
welcome to the forum.

rather than posting the SS of the sheet, post your workbook pls...

My apologies, please find it attached. 22933

mancubus
09-26-2018, 12:53 AM
this is what you need:
http://www.vbaexpress.com/kb/getarticle.php?kb_id=833

download and unzip the attachment.
open the unzipped file and save it as xlsm.