I am working with VBA in ExcelUltimately I am trying to take a huge amount of data (9500-10000 rows) and do a search for text including the words "Violated Door". I then want to take the rows (which contain Date in one cell, time in another, building name, room, etc) which contain that text in the description, copy and paste them into another workbook in Excel. I have created a program to do a simple "find, copy, paste, return, find next, copy, paste, return, etc," but I wanted to loop the program. So, I wanted to do a COUNTIF and find out how many rows contain the words "Violated Door", and then assign that number to a variable. I then want to take that variable and loop it that many times using a Do...Until and have it stop once it has reached that number.
So, I'm looking for help with 2 things:
1) how do I assign that COUNTIF result to a variable,
and 2) What will my Do Until line look like? I was thinking something like:
Any help would be awesome. Thanks!
So, I'm looking for help with 2 things:
1) how do I assign that COUNTIF result to a variable,
and 2) What will my Do Until line look like? I was thinking something like:
Code:
Dim i As Integer = 0 Do Until i = [variable] Loop
Comment