I was trying to create a simple function in Excel VBA editor. When I click on a cell within the certain range, I want to copy its value into another cell I have set.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Selection.Count = 1 Then
If Not Intersect(Target, Range("B3:N15")) Is Nothing Then
ActiveSheet.Range("B17").Value = Target.Value
End If
End If
End Sub
However, when a cell contains pure numbers, e.g. 22, the value that appears on B17 is "2200%", which is not what I want. Any suggestions?