Hi,
I have problem with addressing this issue. Is it possible to make this code shorter in any way.
In reality , I am using digital caliper to put some data into excel. Data are the number of the caliper - integer, and measurement - decimal number.
The problem is that caliper is writing this to 2 cells next to each other ( exam. A1 and A2 )and immediately after that putting active cell in next row under B1.
I wrote a code but the number of the rows in this table in worksheet is from 1-50.
Can you please help with this.
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
If IsNumeric(Target) And Target.Address = "$E$5" Then
Select Case Target.Value
Case Is > 0: ActiveCell.Offset(-1, 2).Select
End Select
End If
If IsNumeric(Target) And Target.Address = "$G$5" Then
Select Case Target.Value
Case Is > 0: ActiveCell.Offset(-1, 2).Select
End Select
End If
If IsNumeric(Target) And Target.Address = "$I$5" Then
Select Case Target.Value
Case Is > 0: ActiveCell.Offset(0, -4).Select
End Select
End If
If Target.Cells.Count > 1 Then Exit Sub
If IsNumeric(Target) And Target.Address = "$E$6" Then
Select Case Target.Value
Case Is > 0: ActiveCell.Offset(-1, 2).Select
End Select
End If
If IsNumeric(Target) And Target.Address = "$G$6" Then
Select Case Target.Value
Case Is > 0: ActiveCell.Offset(-1, 2).Select
End Select
End If
If IsNumeric(Target) And Target.Address = "$I$6" Then
Select Case Target.Value
Case Is > 0: ActiveCell.Offset(0, -4).Select
End Select
End If
End Sub
I have problem with addressing this issue. Is it possible to make this code shorter in any way.
In reality , I am using digital caliper to put some data into excel. Data are the number of the caliper - integer, and measurement - decimal number.
The problem is that caliper is writing this to 2 cells next to each other ( exam. A1 and A2 )and immediately after that putting active cell in next row under B1.
I wrote a code but the number of the rows in this table in worksheet is from 1-50.
Can you please help with this.
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
If IsNumeric(Target) And Target.Address = "$E$5" Then
Select Case Target.Value
Case Is > 0: ActiveCell.Offset(-1, 2).Select
End Select
End If
If IsNumeric(Target) And Target.Address = "$G$5" Then
Select Case Target.Value
Case Is > 0: ActiveCell.Offset(-1, 2).Select
End Select
End If
If IsNumeric(Target) And Target.Address = "$I$5" Then
Select Case Target.Value
Case Is > 0: ActiveCell.Offset(0, -4).Select
End Select
End If
If Target.Cells.Count > 1 Then Exit Sub
If IsNumeric(Target) And Target.Address = "$E$6" Then
Select Case Target.Value
Case Is > 0: ActiveCell.Offset(-1, 2).Select
End Select
End If
If IsNumeric(Target) And Target.Address = "$G$6" Then
Select Case Target.Value
Case Is > 0: ActiveCell.Offset(-1, 2).Select
End Select
End If
If IsNumeric(Target) And Target.Address = "$I$6" Then
Select Case Target.Value
Case Is > 0: ActiveCell.Offset(0, -4).Select
End Select
End If
End Sub