UnsolvedCoding
Technical User
I am running into two separate issues that happen about the same time.
First I have to find a way to adjust where information is put on an excel sheet for specific sequences of a loop. For example, if the desired cell for all iterations is D24 thats fine, but if there is a specific condition that changes it to E25 I need to be able to do that.
Second - because of users being able to stop macro execution I need to find a way so that if the code is stopped screen updating becomes true.
Any ideas on either of these?
This is a sample of the coded loop
It has taken me a while to make sense of what I hear at work involving computers. There is much talk of bugs and questions about Raid.
Therefore I have come to the logical conclusion that the only way to have a properly functioning computer is to regularly spray it with Raid bug killer.
First I have to find a way to adjust where information is put on an excel sheet for specific sequences of a loop. For example, if the desired cell for all iterations is D24 thats fine, but if there is a specific condition that changes it to E25 I need to be able to do that.
Second - because of users being able to stop macro execution I need to find a way so that if the code is stopped screen updating becomes true.
Any ideas on either of these?
This is a sample of the coded loop
Code:
If B = 1 And INPUT_COUNT > 1 Then D = 7
' Put Description on worksheet
3800: Sheets(CB_PANEL_NAME).Cells(C + 1, D).Value = DIGITAL_INPUT_ARRAY(I - 1)
' Put Reference on worksheet
3900: Sheets(CB_PANEL_NAME).Cells(C + 1, D + 1).Value = DIGITAL_INPUT_ARRAY(I)
' Put Nickname on worksheet
4000: Sheets(CB_PANEL_NAME).Cells(C + 1, D + 3).Value = DIGITAL_INPUT_ARRAY(I - 2) 'I=1
4100: J = J - 1
4200: TEST4 = TEST4 - 1
4300: If J = 0 Then GoTo 1500
If B = 3 And INPUT_COUNT > 1 Then C = 25: D = -5
' If I - 6 is outside of array check if I - 3 is valid
4400: If I - 6 <= LBound(DIGITAL_INPUT_ARRAY) Then GoTo 5700
' Set variable for numbering the wires
4500: X = X + 1
4600: If DIGITAL_INPUT_ARRAY(I - 6) = "DI" Then X = X - 1
' Set number of wires
4700: TEST = "24VDC(" & X & ")"
4800: TEST2 = "0VDC(" & X & ")"
' Put Nickname on worksheet
4900: Sheets(CB_PANEL_NAME).Cells(C + 1, D + 6).Value = DIGITAL_INPUT_ARRAY(I - 8) 'I=1
' Put reference on worksheet
5000: Sheets(CB_PANEL_NAME).Cells(C + 1, D + 8).Value = DIGITAL_INPUT_ARRAY(I - 6) 'I=1
' Put Description on worksheet
5100: Sheets(CB_PANEL_NAME).Cells(C + 1, D + 9).Value = DIGITAL_INPUT_ARRAY(I - 7)
5200: J = J - 1
' Put voltage wires on worksheet
5300: If Not IsEmpty(TEST) Then Sheets(CB_PANEL_NAME).Cells(C + 1, D + 5).Value = TEST
5400: If Not IsEmpty(TEST2) Then Sheets(CB_PANEL_NAME).Cells(C + 1, D + 4).Value = TEST2
5500: TEST4 = TEST4 - 1
5600: If J = 0 Then GoTo 1500
' Reset variable
5700: X = 0
' If I is outside of the array count exit the sub
5800: If I - 3 <= LBound(DIGITAL_INPUT_ARRAY) Then GoTo 2800
' Set variable for numbering the wires
5900: X = X + 1
6000: If DIGITAL_INPUT_ARRAY(I - 3) = "DI" Then X = X - 1
' Set number of wires
6100: TEST = "24VDC(" & X & ")"
6200: TEST2 = "0VDC(" & X & ")"
If B = 2 And INPUT_COUNT > 1 Then C = 24: D = 1
It has taken me a while to make sense of what I hear at work involving computers. There is much talk of bugs and questions about Raid.
Therefore I have come to the logical conclusion that the only way to have a properly functioning computer is to regularly spray it with Raid bug killer.