Private Sub Workbook_SheetChange(ByVal Sh As Object, _
ByVal Target As Range)
Dim actCol, curCol
actCol = Target.Column
If actCol > 52 Then
curCol = Chr(Int((actCol - 1) / 52) + 64) & _
Chr(Int((actCol - 27) / 26) + 64) & _
Chr(Int((actCol - 27) Mod 26) + 65)
ElseIf actCol > 26 Then
curCol = Chr(Int((actCol - 1) / 26) + 64) & _
Chr(Int((actCol - 1) Mod 26) + 65)
Else
curCol = Chr(actCol + 64)
End If
Columns(curCol & ":" & curCol).AutoFit
End Sub
My data entry guys are not to be trusted to touch anything other than putting stuff in the cell. So the simpler I make it for them, the better. Auto-fitting column width has been an issue. They constantly print things out with ##### in a cell...sigh. So, with any excel issue I can't figure out I turn to the guru's. I found the afore mentioned Russian rocket surgery schematics on the intarweb. It appears to do what I need just fine....
However, I have some drop down lists in the workbook, and now said drop downs give me an error code 1004. I can clear it and move on, but, I'd rather not get that when the data entry monkeys are futzing with it. Second, it appears that Ctrl-z no longer functions with this macro floating in the VBA world.
I consider myself fairly savvy on excel for all things NOT code. So before I get responses with add so-n-so to the what's-it line, I need to say, I'm exceedingly good at cutting and pasting code from the web to the VBA world... And that's as far as my Greek translation goes.
Any help would be appreciated.
Thanks
-Gray
Bookmarks