PDA

View Full Version : VBA, where ever the data is found in column BCDEF, macro can still accomplish results



estatefinds
03-22-2016, 10:55 AM
So I have data in Columns BCDEF.
Currently when I run the macro sheet3.NN_snb it will only look at this data in columns BCDEF starting at row 9.
I need to see if the macro can be revised in a way that where ever this data is in Columns BCDEF the macro will still be able to complete its current task. Reason for this is that this data will grow so I need to be able to move the data down the columns and still be able to run macro.

the sheet3.NN_snb when ran looks at the uncolored numbers and places them as as seen on the attached example.
Thank you!

PAB
03-22-2016, 11:27 AM
Hi Dennis, because it uses .CurrentRegion, as you enter data below B43:F43 it will be included in the .CurrentRegion because the .CurrentRegion is extended to accomodate those cells.

I hope this helps!

estatefinds
03-22-2016, 11:58 AM
ok so I see what you are saying, but my history of data I will have to start more than 350,000 rows down on the worksheet so each time new data is added the numbers that are uncolored will change so this is why I need this to be able to retrieve data where ever the data in columns BCDEF. So I add data to the top of the data in columns BCDEF, so data is always changing as data id added to data on top of BCDEF. so it will always retrieve the data that is uncolored no matter what row within the columns BCDEF.
Thank you

PAB
03-22-2016, 12:11 PM
But surely you will insert cells in range B:F down and then fill them with new data, this will still be included in the .CurrentRegion as long as the data starts on row 9?

estatefinds
03-22-2016, 12:32 PM
No, The data will actually start down below in the neighbor hood of 350,000 rows down and as I add this data it will reach to the ROW 9 eventually. so since data is stacked on the previous data moving toward the top of the worksheet this is why I need it to be able to read in any row. as long as the rest of the numbers are in red and there are white numbers remaining, the macro will read the uncolored the numbers.

estatefinds
03-29-2016, 05:38 AM
is there any way to rewrite the code so the macro can read the data in the columns BCDEF where ever it is in these columns?