epactheactor
New Member
- Joined
- Sep 9, 2015
- Messages
- 38
Hello!
I'm studying VBA and actually trying to get a degree in programming so every chance I get to practice at work with code, I do so.
I've come up with something I want to do, but can't get my head around HOW to do it.
On Workbook 1 (called "Line" as an example), I would have 2 columns with one being Start and the other End (columns D & E). These would a path in feet for inspection.
Also on this sheet, there would be a section for the information on who and when they did the inspection on different parts of the line (A1:C4).
Example;
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]1[/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]Inspector ID section[/TD]
[TD]Name[/TD]
[TD]Date[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]A[/TD]
[TD]Joe[/TD]
[TD]5/1/2019[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]G[/TD]
[TD]Dana[/TD]
[TD]6/5/2016[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD][/TD]
[TD][/TD]
[TD]Inspected by[/TD]
[TD]To (feet)[/TD]
[TD]From (feet)[/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD][/TD]
[TD][/TD]
[TD]A[/TD]
[TD]0[/TD]
[TD]7[/TD]
[/TR]
[TR]
[TD]8[/TD]
[TD][/TD]
[TD][/TD]
[TD]G[/TD]
[TD]7[/TD]
[TD]50[/TD]
[/TR]
[TR]
[TD]9[/TD]
[TD][/TD]
[TD][/TD]
[TD]A[/TD]
[TD]50[/TD]
[TD]62[/TD]
[/TR]
[TR]
[TD]10[/TD]
[TD][/TD]
[TD][/TD]
[TD]A[/TD]
[TD]62[/TD]
[TD]100[/TD]
[/TR]
[TR]
[TD]11[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]12[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]13[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Now to make this harder, the Inspector ID information (A1:C4) comes from a different workbook called "Inspector ID". It is presented like this;
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Inspector Info[/TD]
[TD]Name[/TD]
[TD]Date Inspected (newest - oldest)[/TD]
[TD]Inspected To (feet)[/TD]
[TD]Inspected From (feet)[/TD]
[/TR]
[TR]
[TD]A[/TD]
[TD]Joe[/TD]
[TD]5/1/2019[/TD]
[TD]0[/TD]
[TD]7[/TD]
[/TR]
[TR]
[TD]A[/TD]
[TD]Joe[/TD]
[TD]5/1/2019[/TD]
[TD]50[/TD]
[TD]62[/TD]
[/TR]
[TR]
[TD]A[/TD]
[TD]Joe[/TD]
[TD]5/1/2019[/TD]
[TD]62[/TD]
[TD]100[/TD]
[/TR]
[TR]
[TD]D[/TD]
[TD]Dana[/TD]
[TD]6/5/2016[/TD]
[TD]7[/TD]
[TD]50[/TD]
[/TR]
</tbody>[/TABLE]
I've created a code that puts the Inspector ID section (range A2:C4) information into workbook "Line" from workbook "Inspector ID." After it does, I've been manually filling out the "Inspected By" (C6:C10) section.
My question is, how would I go about filling out the "Inspected By" column in "Line"? It would have to reference the "Inspector ID" workbook to see the footages of who did which.
I would think I would need to create each Inspector info as an array/index, then compare the To and From.
Any help would be greatly appreciated.
I'm studying VBA and actually trying to get a degree in programming so every chance I get to practice at work with code, I do so.
I've come up with something I want to do, but can't get my head around HOW to do it.
On Workbook 1 (called "Line" as an example), I would have 2 columns with one being Start and the other End (columns D & E). These would a path in feet for inspection.
Also on this sheet, there would be a section for the information on who and when they did the inspection on different parts of the line (A1:C4).
Example;
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]1[/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]Inspector ID section[/TD]
[TD]Name[/TD]
[TD]Date[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]A[/TD]
[TD]Joe[/TD]
[TD]5/1/2019[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]G[/TD]
[TD]Dana[/TD]
[TD]6/5/2016[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD][/TD]
[TD][/TD]
[TD]Inspected by[/TD]
[TD]To (feet)[/TD]
[TD]From (feet)[/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD][/TD]
[TD][/TD]
[TD]A[/TD]
[TD]0[/TD]
[TD]7[/TD]
[/TR]
[TR]
[TD]8[/TD]
[TD][/TD]
[TD][/TD]
[TD]G[/TD]
[TD]7[/TD]
[TD]50[/TD]
[/TR]
[TR]
[TD]9[/TD]
[TD][/TD]
[TD][/TD]
[TD]A[/TD]
[TD]50[/TD]
[TD]62[/TD]
[/TR]
[TR]
[TD]10[/TD]
[TD][/TD]
[TD][/TD]
[TD]A[/TD]
[TD]62[/TD]
[TD]100[/TD]
[/TR]
[TR]
[TD]11[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]12[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]13[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Now to make this harder, the Inspector ID information (A1:C4) comes from a different workbook called "Inspector ID". It is presented like this;
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Inspector Info[/TD]
[TD]Name[/TD]
[TD]Date Inspected (newest - oldest)[/TD]
[TD]Inspected To (feet)[/TD]
[TD]Inspected From (feet)[/TD]
[/TR]
[TR]
[TD]A[/TD]
[TD]Joe[/TD]
[TD]5/1/2019[/TD]
[TD]0[/TD]
[TD]7[/TD]
[/TR]
[TR]
[TD]A[/TD]
[TD]Joe[/TD]
[TD]5/1/2019[/TD]
[TD]50[/TD]
[TD]62[/TD]
[/TR]
[TR]
[TD]A[/TD]
[TD]Joe[/TD]
[TD]5/1/2019[/TD]
[TD]62[/TD]
[TD]100[/TD]
[/TR]
[TR]
[TD]D[/TD]
[TD]Dana[/TD]
[TD]6/5/2016[/TD]
[TD]7[/TD]
[TD]50[/TD]
[/TR]
</tbody>[/TABLE]
I've created a code that puts the Inspector ID section (range A2:C4) information into workbook "Line" from workbook "Inspector ID." After it does, I've been manually filling out the "Inspected By" (C6:C10) section.
My question is, how would I go about filling out the "Inspected By" column in "Line"? It would have to reference the "Inspector ID" workbook to see the footages of who did which.
I would think I would need to create each Inspector info as an array/index, then compare the To and From.
Any help would be greatly appreciated.