Consulting

Results 1 to 6 of 6

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

  1. #1
    VBAX Mentor
    Joined
    Feb 2016
    Posts
    382
    Location

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

    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!

  2. #2
    VBAX Tutor PAB's Avatar
    Joined
    Nov 2011
    Location
    London (UK)
    Posts
    243
    Location
    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!
    -----------------------------------------∏-

    12:45, restate my assumptions.
    Mathematics is the language of nature.
    Everything around us can be represented and understood through numbers.
    If you graph the numbers of any system, patterns emerge. Therefore, there are patterns everywhere in nature.

    -----------------------------------------∏-

  3. #3
    VBAX Mentor
    Joined
    Feb 2016
    Posts
    382
    Location

    vba

    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

  4. #4
    VBAX Tutor PAB's Avatar
    Joined
    Nov 2011
    Location
    London (UK)
    Posts
    243
    Location
    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?
    -----------------------------------------∏-

    12:45, restate my assumptions.
    Mathematics is the language of nature.
    Everything around us can be represented and understood through numbers.
    If you graph the numbers of any system, patterns emerge. Therefore, there are patterns everywhere in nature.

    -----------------------------------------∏-

  5. #5
    VBAX Mentor
    Joined
    Feb 2016
    Posts
    382
    Location
    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.
    Last edited by estatefinds; 03-22-2016 at 12:58 PM.

  6. #6
    VBAX Mentor
    Joined
    Feb 2016
    Posts
    382
    Location
    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?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •