none
putting a border in my VBA code RRS feed

  • General discussion

  • I want to extend my code to include adding "all Border" for each cell i add data to with a xlContinouos. I wrote this but it does not work.

    Do While Not EOF(f)
        Line Input #f, strLine
        If strLine = "END" Then
                    Exit Do
                End If
        arrParts = Split(strLine, vbTab)
        strPartA = arrParts(2) ' 3rd part
        strPartC = arrParts(6) 'Nominal
        strPartD = arrParts(7) 'High Tol
        strPartE = arrParts(8) ' Lower Tol
        Sheet1.Cells(r, c) = strPartA
        Sheet1.Cells(r + 1, c) = strPartC
        Sheet1.Cells(r + 2, c) = Left(strPartE, 6) & "/" & Left(strPartD, 6)
        Range(Cells(r, c), Cells(r + 2, c)).Borders.LineStyle = xlContinouos
        c = c + 1
        Loop 'loop thru to get all headers
    Close #f


    Jim Neely

    Tuesday, January 29, 2013 5:41 PM

All replies