Answer the question
In order to leave comments, you need to log in
How to add the same to links in excel?
Good afternoon, please tell me, there is a price list, which contains links to pictures of goods. Previously, the links worked as they are, but recently the hosting has changed the settings, and now you need to add an extension to all links, namely .jpg . Since there are a lot of goods, is it possible to do this in bulk somehow?
Links look like this:
Answer the question
In order to leave comments, you need to log in
With a macro:
Sub AppendExt()
Dim WB As Workbook
Dim WS As Worksheet
Dim Ri As Integer
Dim Rj As Integer
Dim Ci As Integer
Dim Cj As Integer
Set WB = Excel.ActiveWorkbook
Set WS = WB.Worksheets("list1")
' Диапазон ячеек для замены
' Начальная строка
Ri = 1
' Конечная строка
Rj = 4
' Начальный столбец
Ci = 1
' Конечный столбец
Cj = 2
For C = Ci To Cj
For R = Ri To Rj
If Not IsEmpty(WS.Cells(R, C)) Then
WS.Cells(R, C).Value = WS.Cells(R, C).Value & ".jpg"
End If
Next R
Next C
End Sub
Sub AppendExt()
Dim WB As Workbook
Dim WS As Worksheet
Set WB = Excel.ActiveWorkbook
Set WS = WB.Worksheets("list1")
For Each HL In WS.Hyperlinks
HL.Address = HL.Address & ".jpg"
Next
End Sub
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question