Ok, so thanks for the help guys. Having never worked with Excel VBS you got me started in the right direction. Now that I've come up with some code to work with, it's giving me some errors that I have not been able to correct:
Code:
Sub CommandButton1_Click()
Dim columnBWidth As Single, columnCWidth As Single, totalWidth As Single
columnBWidth = Columns("b").ColumnWidth
columnCWidth = Columns("c").ColumnWidth
totalWidth = columnBWidth + columnCWidth
Do While Selection.Columns.Count = 2
With Selection
Dim columnBNewWidth As Single, columnCAdjustedWidth As Single
columnBNewWidth = Selection(1).ColumnWidth
columnCAdjustedWidth = totalWidth - columnBNewWidth
Worksheets("Sheet1").Range("c:c").ColumnWidth = columnCAdjustedWidth
End With
Loop
MsgBox ("Ended.")
End Sub
So, as stated in the OP, when dragging to resize Column B I'm trying to auto-resize Column C to maintain the original width of B + C. Using some MsgBox'es along the way to test the returns seems good. But when I try to resize C, Excel crashes.
I tried wrapping
Worksheets("Sheet1").Range(Columns("c:c")).ColumnW idth = columnCAdjustedWidth with
Sub Column_Width() but after looking up that error I learnt that you can't overlap subroutines.
I'm not ashamed to say I've spent all evening on this
My experience with writing code is as a self-taught ArmA coder, so I'm used to putting in unreasonable amounts of time to make something work on my own. But now I'm stuck. How do I get this to work?