13

考虑以下 Excel 工作表:

     A             B                       C
1 ASX:ANZ      ANZ:ASX       http://www.site.com/page?id=ANZ:ASX
2 DOW:1234     1234:DOW      http://www.site.com/page?id=1234:DOW
3 NASDAQ:EXP   EXP:NASDAQ    http://www.site.com/page?id=EXP:NASDAQ

我需要BC列的公式。在B列中,我需要A拆分列的值:并反转两个结果部分,请参见三个示例。在C列中,我需要将结果B添加到(硬拷贝)URL ( http://www.site.com/page?id=) 以形成链接。

谁能帮帮我?非常感谢您的帮助!

4

3 回答 3

25

好吧。我通常不会用勺子喂答案,但给你。

在 B 中:

=MID(A1, FIND(":", A1, 1)+1, LEN(A1) - FIND(":",A1,1)) & ":"&MID(A1,1,FIND(":",A1,1)-1)

在 C 中:

=HYPERLINK("http://www.site.com/page?id="&B1)
于 2013-05-03T14:56:57.927 回答
5
=hyperlink("http://www.site.com/page?id="&B1) *english version *
于 2013-05-03T15:02:22.593 回答
0

循环看起来像他的:

Dim row As Integer
Dim snumber As Variant
Dim TestCell As String
Dim lastcell As Integer

Sheets("data").Select


lastcell = Sheets("data").Cells(Rows.Count, "A").End(xlUp).row

For row = 1 To lastcell
    TestCell = "A" & row
    snumber = Range(TestCell).Value
    If snumber <> "" And snumber <> "0" Then
        Range(TestCell).Select
        ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:= _
        "url goes here", TextToDisplay:=snumber
    End If
Next row
于 2013-05-03T15:12:47.870 回答