Twin problem here. End User wants to enter a number in either of two columns and have them convert automatically to "unlimited hours and minutes" (e.g. entering "2700" results in "27:00" in cell).
(a) Can't see why the following Worksheet_Change macro in attached file iforum.ozgrid.com/index.php?attachment/64272/ isn't doing that
(b) Can't see how to adapt the Code so it works on either of two "target" columns?
Option Explicit Private Sub Worksheet_Change(ByVal Target As Range) Dim rngCell As Range On Error GoTo ExitPoint If Target.Cells.Count > 1 Then Exit Sub If Intersect(Target, Columns(1)) Is Nothing Then Exit Sub Application.EnableEvents = False For Each rngCell In Intersect(Target, Columns(1)).Cells If IsNumeric(rngCell.Value) Then With rngCell .NumberFormat = "[h]:mm" End With End If Next rngCell ExitPoint: Application.EnableEvents = True End Sub
All suggestions welcomed gratefully