Macro will not work - Please help

J

JayLatimer

I have a macro which converts urls in a column to the words "Tax Record" but
the macro will not work. I would appreicate any help I can get. The Marco is:

Sub chngelink()
'
' chngelink Macro
'
' Keyboard Shortcut: Ctrl+z
Sub ChangelinkT()
Dim MyCol As String
Dim MySht As String
On Error Resume Next
MyCol = InputBox("Enter column LETTER(S)")
MySht = InputBox("Enter sheet name")
Lastrow = Sheets(MySht).Cells(Cells.Rows.Count, MyCol).End(xlUp).Row
For Each c In Sheets(MySht).Range(MyCol & "2:" & MyCol & Lastrow)
c.Hyperlinks(1).TextToDisplay = "Tax record"
Next
End Sub
 
F

FSt1

hi
you have two line begining with sub but only one end sub. are you getting an
error message about "expected end sub"?
remove one on the sub lines and rerun the macro.

Regards
FSt1
 
S

Shane Devenshire

Hi,

In addition to the earlier comment let me add that using Ctr+z is not a good
idea, it will work but that shortcut key is Excel Undo command, which you
loose by assigning lower case z. I would recommend Ctrl+Z.
 
J

JayLatimer

Hi,
I got rid of the additional sub line but the Macro still doesn/t work. As a
matter of fact I do not get any error message either. It asks for the Column
and then the sheet. WHen supplied whit the information nothing happens (url's
are not transformed in the column. Do you have any additional suggestions?
 
J

JayLatimer

Hi,
I got rid of the additional sub line but the Macro still doesn/t work. As a
matter of fact I do not get any error message either. It asks for the Column
and then the sheet. WHen supplied whit the information nothing happens (url's
are not transformed in the column. Do you have any additional suggestions?
 

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