Hello,
Currently I have a dropbox that allows the user to choose:
Hong Kong
London
Berlin
I have an If statement that determines what address to display dependent upon the city chosen from the dropbox. My issue is that the formula seems to work but requires me to actually click into the formula and then hit enter to get it to actually register the change within the dropbox.
Is there a way around this problem? I attempted to use a vba (code below) but that doesn't seem to work either. Any help is greatly appreciated.
Sub updateifs()
If Range("location") = "Hong Kong" Then
Range("A2") = "Middle Road / Nathan Road, Hong Kong, Kowloon, Hong Kong"
Else
If Range("location") = "London" Then
Range("A2") = "30 Portman Square London W1H 7BH United Kingdom"
Else
Range("A2") = "Eichhornstrabe Berlin Germany"
End If
End If
If Range("location") = "Hong Kong" Then
Range("A3") = "8A Hart Avenue Hong Kong Kowloon Hong Kong"
Else
Range("A3") = ""
End If
If Range("location") = "Hong Kong" Then
Range("A4") = "1 Hanoi Road Tsim Sha Tsui Kowloon"
Else
Worksheets("Google Street View").Range("A4") = ""
End If
End Sub
^Based on:
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Target.Worksheet.Range("H5")) Is Nothing Then
Sheet18.updateifs
End If
End Sub
Currently I have a dropbox that allows the user to choose:
Hong Kong
London
Berlin
I have an If statement that determines what address to display dependent upon the city chosen from the dropbox. My issue is that the formula seems to work but requires me to actually click into the formula and then hit enter to get it to actually register the change within the dropbox.
Is there a way around this problem? I attempted to use a vba (code below) but that doesn't seem to work either. Any help is greatly appreciated.
Sub updateifs()
If Range("location") = "Hong Kong" Then
Range("A2") = "Middle Road / Nathan Road, Hong Kong, Kowloon, Hong Kong"
Else
If Range("location") = "London" Then
Range("A2") = "30 Portman Square London W1H 7BH United Kingdom"
Else
Range("A2") = "Eichhornstrabe Berlin Germany"
End If
End If
If Range("location") = "Hong Kong" Then
Range("A3") = "8A Hart Avenue Hong Kong Kowloon Hong Kong"
Else
Range("A3") = ""
End If
If Range("location") = "Hong Kong" Then
Range("A4") = "1 Hanoi Road Tsim Sha Tsui Kowloon"
Else
Worksheets("Google Street View").Range("A4") = ""
End If
End Sub
^Based on:
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Target.Worksheet.Range("H5")) Is Nothing Then
Sheet18.updateifs
End If
End Sub