Special characters in a string variable

B

ben.biddle

Here's my abbreviated code:

Private Sub Worksheet_Change(ByVal Target As Range)
For each cell in Target
If cell.column = 1 and cell.row > 1 Then
ticker = CStr(UCase(Trim(cell.value)))
Call LinkRef (ticker)
End if
Next cell
End Sub


Sub LinkRef(ticker)
MsgBox ticker
End Sub

Of course the full procedure does more than display the message box.
The problem I'm having is that if the value in the target cell begins
with a special character, like $ or % as in $DJI or %GOOG, the sub
routine does not seem to execute. I've tried removing the UCase(),
Trim() and Cstr() to see if any of those could be the culprit, but no
such luck. Any insight into what might be the cause here? Any
solutions?

Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top