Use the Trim function to remove leading space as under:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Dim i As Integer
i = Int((8 - 2 + 1) * Rnd + 2)
Dim rg As String
Dim con As String
con = Str(i)
rg = "B" & Trim(con)
MsgBox (rg)
End Sub