Try to search your question here, if you can't find : Ask Any Question Now ?

Will not process to the next line

HomeCategory: stackoverflowWill not process to the next line
Avatarpushpa asked 4 months ago

Ok here it is, I have this VBA code in Excel that I am trying to take certain data from one tab to another tab and edit that data. I am getting almost everything to complete except when I run it I get a dialog box that comes up and says “Select Range”. It should take the data in the selected cell and add it to the end of a given URL, with the cell Value shown, so that when clicked it will take you to the page with the given ID and URL combined.

Here is the code:

'Hyperlink column A
Dim WorkRng As Range
Set WorkRng = Application.Selection
Dim l As Long
Dim addr As String
For l = WorkRng.Rows.Count To 1 Step -1
    If WorkRng.Cells(l, 1).Value <> "" Then
        addr = CStr("") & CStr(WorkRng.Cells(l, 1).Value)
        WorkRng.Cells(l, 1).Hyperlinks.Add Anchor:=WorkRng.Cells(l, 1), _
        Address:=addr, _
        TextToDisplay:=CStr(WorkRng.Cells(i, 1).Value)
    End If
Next l

This refuses to go to the next line till it reaches the last row.

Any thoughts?

1 Answers
Best Answer
AvatarJyoti answered 4 months ago
Your Answer

1 + 17 =

Popular Tags

WP Facebook Auto Publish Powered By :