I have the following simple program I am using to locate lockout points within this large building I am working in.
Private Sub but1afe_Click()
Dim i As Integer
For i = 2 To 1000
If Sheet5.Cells(i, 1).Value = txtAssetafe.Text Then
txtlocationafe.Text = Sheet5.Cells(i, 2).Value
txtP1afe.Text = Sheet5.Cells(i, 3).Value
txtE1afe.Text = Sheet5.Cells(i, 4).Value
txtE2afe.Text = Sheet5.Cells(i, 5).Value
txt6ft1afe.Text = Sheet5.Cells(i, 7).Value
txt6e1afe.Text = Sheet5.Cells(i, 8).Value
txt6ft2afe.Text = Sheet5.Cells(i, 9).Value
txt6e2afe.Text = Sheet5.Cells(i, 10).Value
Exit For
End If
Next i
No stretch just simply programming. However, in my excel sheet I have a host of lockout points that are within six feet of one another and policy states that you must lockout any equipment within 6 feet so my spreadsheet looks like this.
Is there anyway I can reduce the redundancy within the spreadsheet and still have it work correctly. Please note that I am trying my best to keep this simple as I will be leaving this building soon and the one that is taking my place on this project is just now learning the VBA side of excel.
Thanks
Private Sub but1afe_Click()
Dim i As Integer
For i = 2 To 1000
If Sheet5.Cells(i, 1).Value = txtAssetafe.Text Then
txtlocationafe.Text = Sheet5.Cells(i, 2).Value
txtP1afe.Text = Sheet5.Cells(i, 3).Value
txtE1afe.Text = Sheet5.Cells(i, 4).Value
txtE2afe.Text = Sheet5.Cells(i, 5).Value
txt6ft1afe.Text = Sheet5.Cells(i, 7).Value
txt6e1afe.Text = Sheet5.Cells(i, 8).Value
txt6ft2afe.Text = Sheet5.Cells(i, 9).Value
txt6e2afe.Text = Sheet5.Cells(i, 10).Value
Exit For
End If
Next i
No stretch just simply programming. However, in my excel sheet I have a host of lockout points that are within six feet of one another and policy states that you must lockout any equipment within 6 feet so my spreadsheet looks like this.
txtasset | txtlocation | txtP1 | txtE1 | txtE2 | Within 6 | txt6ft1 | txt6e1 | txt6p1 | txt6ft2 | txt6e2 | txt6p2 |
45180 | Lane 1 101/102 | P-144 | E-3836 | 45185 | E-3835 | 44748 | E-3089 | ||||
45185 | Lane 1 101/102 | E-3835 | 45180 | E-3836 | P-144 | 45190 | E-3834 | ||||
45190 | Lane 1 101/102 | E-3834 | 45185 | E-3835 | 45195 | E-3833 | |||||
45195 | Lane 1 101/102 | E-3833 | 45190 | E-3834 | 45005 | ||||||
45275 | Lane 2 103/104 | E-3838 | 45280 | E3840 | P-145 | 44720 | E-???? | ||||
45280 | Lane 2 103/104 | P-145 | E-3840 | 45275 | E-3838 | 45285 | E-3843 | ||||
45285 | Lane 2 103/104 | E-3843 | 45280 | E-3840 | P-145 | 45290 | E-3845 | ||||
45290 | Lane 2 103/104 | E-3845 | 45285 | E-3843 | 45295 | E-3880 | |||||
45295 | Lane 2 103/104 | E-3880 | 45290 | E-3880 | 45005 | ||||||
45375 | Lane 3 105/106 | E-3839 | 43920 | E-3093 | 45380 | E-3841 | P-146 |
Thanks