Hi, beIow you will see my Excel VBA code. It will expand to until A120. Could you please shorten the code?
Thanks,
Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
If Target.Range.Address = "$A$20" Then [AR1] = 0: [A1] = Range("A20").Value: Call BOM: Exit Sub
If Target.Range.Address = "$A$21" Then [AR1] = 0: [A1] = Range("A21").Value: Call BOM: Exit Sub
If Target.Range.Address = "$A$22" Then [AR1] = 0: [A1] = Range("A22").Value: Call BOM: Exit Sub
If Target.Range.Address = "$A$23" Then [AR1] = 0: [A1] = Range("A23").Value: Call BOM: Exit Sub
If Target.Range.Address = "$A$24" Then [AR1] = 0: [A1] = Range("A24").Value: Call BOM: Exit Sub
If Target.Range.Address = "$A$25" Then [AR1] = 0: [A1] = Range("A25").Value: Call BOM: Exit Sub
If Target.Range.Address = "$A$26" Then [AR1] = 0: [A1] = Range("A26").Value: Call BOM: Exit Sub
If Target.Range.Address = "$A$27" Then [AR1] = 0: [A1] = Range("A27").Value: Call BOM: Exit Sub
If Target.Range.Address = "$A$28" Then [AR1] = 0: [A1] = Range("A28").Value: Call BOM: Exit Sub
If Target.Range.Address = "$A$29" Then [AR1] = 0: [A1] = Range("A29").Value: Call BOM: Exit Sub
If Target.Range.Address = "$A$30" Then [AR1] = 0: [A1] = Range("A30").Value: Call BOM: Exit Sub
End Sub
Thanks,
Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
If Target.Range.Address = "$A$20" Then [AR1] = 0: [A1] = Range("A20").Value: Call BOM: Exit Sub
If Target.Range.Address = "$A$21" Then [AR1] = 0: [A1] = Range("A21").Value: Call BOM: Exit Sub
If Target.Range.Address = "$A$22" Then [AR1] = 0: [A1] = Range("A22").Value: Call BOM: Exit Sub
If Target.Range.Address = "$A$23" Then [AR1] = 0: [A1] = Range("A23").Value: Call BOM: Exit Sub
If Target.Range.Address = "$A$24" Then [AR1] = 0: [A1] = Range("A24").Value: Call BOM: Exit Sub
If Target.Range.Address = "$A$25" Then [AR1] = 0: [A1] = Range("A25").Value: Call BOM: Exit Sub
If Target.Range.Address = "$A$26" Then [AR1] = 0: [A1] = Range("A26").Value: Call BOM: Exit Sub
If Target.Range.Address = "$A$27" Then [AR1] = 0: [A1] = Range("A27").Value: Call BOM: Exit Sub
If Target.Range.Address = "$A$28" Then [AR1] = 0: [A1] = Range("A28").Value: Call BOM: Exit Sub
If Target.Range.Address = "$A$29" Then [AR1] = 0: [A1] = Range("A29").Value: Call BOM: Exit Sub
If Target.Range.Address = "$A$30" Then [AR1] = 0: [A1] = Range("A30").Value: Call BOM: Exit Sub
End Sub