ctouchberry
New Member
- Joined
- Dec 4, 2017
- Messages
- 40
I'm not sure what's wrong with my code. The loop in question "loops", but the TagRowCounter variable stops increasing at 318. This is right where part of the logic starts "working", or NOT working in this case.
What I'm trying to do is list Tag Numbers with their respective Rooms. Every Tag Number has a Room, and a Tag Number can only be associated with 1 Room. That "listing" part works perfectly.
What I'm having issues with is about the "Room, Room" values shown on the Component 2 attachment. Those Rooms need to be NOT listed, and also have the spot that would be occupied by them..by the next "Room" value. In this case, there's about 150-200 "Room, Room" values in a row that need to be skipped entirely. Unfortunately, I can't tell the program to skip certain lines, as the source content is fluid and will change. It has to be smart enough to figure it out without specific row numbers noted.
There's about 4500 rows to be listed after the "Room, Room" values stop, and this glitch is preventing those from being listed, as well as pausing the rest of the program.
I apologize for not having the screenshots shown better, I'm having issues getting the HTML Maker tool properly installed.
The single "Room" values that worked so far are shown in Component 1. The final results are listed on JCX. I have not attached a picture of the "not-listing" result on the JCX sheet, as it's just a blank cell.
JCX
https://imgur.com/a/3DZFm
Component 1
https://imgur.com/a/J3lvs
Component 2
https://imgur.com/a/SujzZ
What I'm trying to do is list Tag Numbers with their respective Rooms. Every Tag Number has a Room, and a Tag Number can only be associated with 1 Room. That "listing" part works perfectly.
What I'm having issues with is about the "Room, Room" values shown on the Component 2 attachment. Those Rooms need to be NOT listed, and also have the spot that would be occupied by them..by the next "Room" value. In this case, there's about 150-200 "Room, Room" values in a row that need to be skipped entirely. Unfortunately, I can't tell the program to skip certain lines, as the source content is fluid and will change. It has to be smart enough to figure it out without specific row numbers noted.
There's about 4500 rows to be listed after the "Room, Room" values stop, and this glitch is preventing those from being listed, as well as pausing the rest of the program.
I apologize for not having the screenshots shown better, I'm having issues getting the HTML Maker tool properly installed.
The single "Room" values that worked so far are shown in Component 1. The final results are listed on JCX. I have not attached a picture of the "not-listing" result on the JCX sheet, as it's just a blank cell.
JCX
https://imgur.com/a/3DZFm
Component 1
https://imgur.com/a/J3lvs
Component 2
https://imgur.com/a/SujzZ
Code:
'Tag Number and Room
Sheets("JCX").Range("A:CZ").<wbr>NumberFormat = "@"
i = 0
Do
'Tag Number
If Not InStr(Sheets("Component").<wbr>Cells(TagRowCounter + i, 5).Value, ",") > 0 Then
Sheets("JCX").Cells(<wbr>TagRowCounter, 10).Value = Sheets("Component").Cells(<wbr>TagRowCounter + i, 1).Value
'Room
Sheets("JCX").Cells(<wbr>TagRowCounter, 9).Value = Sheets("Component").Cells(<wbr>TagRowCounter + i, 5).Value
TagRowCounter = TagRowCounter + 1
Else
i = i + 1
End If
Loop Until Sheets("Component").Cells(<wbr>TagRowCounter + i, 1) = False