Something in the For = A loop is preventing all the cells from being rewritten correctly.
For some reason cell AF4 is the first cell of many not to be written over to the new sheet.
Excel.JPG
That cell should have written a converted value in the new sheet cell D2.
Excel.JPG
Dim WS As Worksheet
Dim UpchainFile As String, DownchainFile As String
Dim LastRow As Long
Dim LastCol As Long
Dim i As Integer
Dim A As Long, B As Long
Dim C As Integer
Set WS = ActiveWorkbook.Sheets("Start")
UpchainFile = Range("B8")
DownchainFile = Range("B9")
WS.Cells(10, 2).Value = ComboBoxPin.Value
WS.Cells(11, 2).Value = ComboBoxStartStation.Value
'Add Vision Upchain output file to current workbook
Set WS = ActiveWorkbook.Sheets("Upchain")
With WS.QueryTables.Add(Connection:="TEXT;" & UpchainFile, Destination:=WS.Range("A1"))
.TextFileParseType = xlDelimited
.TextFileCommaDelimiter = True
.Refresh
End With
'Slim down the upchain data based on user preference
With WS
'Enter Header titles in Upchain Edit Sheet
For C = 1 To 43
Worksheets("Upchain Edit").Cells(1, C + 1).Value = (-2.2 + C / 10)
Next
'Slim down the upchain data based on user preference
LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
LastCol = .Cells(1, .Columns.Count).End(xlToLeft).Column
i = 1
For A = 2 To LastRow 'label rows as A, A=1 at row 2
If .Cells(A, 5) > 0 Then
i = i + 1
For B = 8 To LastCol 'label columns as B, B=1 at column H
'Enter 39 laser readings to string at 1/10th of a meter spacing (about 4in)
For C = 1 To 43
If (.Cells(A, B) <> "") And ((.Cells(1, B).Value = -2.21 + C / 10) Or (.Cells(1, B).Value = -2.2 + C / 10)) Then
Worksheets("Upchain Edit").Cells(i, C + 1).Value = WorksheetFunction.Convert((.Cells(A, B)), "m", "in")
C = 44
End If
Next C
Next B
A = A + 150 '150 skips rows to get down to next 50ft increment
End If
Next
End With
Bookmarks