Hi everyone,
I've wrote this code that allow the user to enter data either in mm or inch and to be converted in the corresponding cell:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim i As Integer
Application.EnableEvents = False
If Not Application.Intersect(Target, Range("G6:G19")) Is Nothing Then
For i = 6 To 19
Cells(i, "I").Value = Cells(i, "G").Value * 25.4
Next i
End If
If Not Application.Intersect(Target, Range("I6:I19")) Is Nothing Then
For i = 6 To 19
Cells(i, "G").Value = Cells(i, "I").Value / 25.4
Next i
End If
Application.EnableEvents = True
End Sub
The issue I'm facing, is that some of the cells in the range should not be concerned by the conversion (other unit or with no unit at all).
So I'd like to edit the code to select the entire column and just ovoid the cells that do not have the right format ("0.0 in" and "0.0 mm")...
I cannot figure out a way of ignoring the cells with a different format.
Thanks in advance for your help.
Bookmarks