For the selected cell(s)/range:
ActiveSheet.Shapes.AddLine Selection.Left, Selection.Top +
(Selection.Height / 2), Selection.Left + Selection.Width,
Selection.Top + (Selection.Height / 2)
If you've set the properties of the Autoshape to 'move and size with
cells' then the left and right of the line should stick to the edges
of the cell when you change column width but the distance from the top
of the cell will remain the same if you were to change the row height.