Forum Discussion

Aless1275's avatar
Aless1275
Copper Contributor
Oct 15, 2021
Solved

Create a routine to check the values of a row in a table and modify the ones of following row

Hi, and thanks for coming here. I'm trying to create a routine that does  what the title says. I have a table where each row represents an hour of the year, to which certain quantities (indicated on...
  • HansVogelaar's avatar
    Oct 15, 2021

    Aless1275 

    In TEST_check_prev_SOC, the line

    Set mySh = Application.ThisWorkbook.Worksheets("Sheet1")

    is superfluous - it has already been set in the calling macro TEST_SOC_logic.

    And the line

    Set focus_SOC = mySh.Range("D2")

    resets focus_SOC to D2 each time after it has been changed in the calling macro.

    So remove those two lines from TEST_check_prev_SOC

Resources