在单独的列中需要Excel公式 [英] Excel Formula needed in separate column

查看:115
本文介绍了在单独的列中需要Excel公式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想不通,也许你们可以帮助我.

I can't figure this out, Maybe you guys can help me.

例如,我只需要分隔图像名称

I need to separate just the image name for example

xxqti8eli5h2f4abpiz2.jpg
lvfdpujvgkf75ve8ikob.jpg

在单独的一列中,我列出了8000个图像名称,我需要将它们与大家分开来.

In a separate column, I've a list of 8000 image name which I need to separate out any help from you guys is much appreciated.

http://images.XXX.com/image/upload/s--B3cI5sks--/c_limit,cs_srgb,h_600,w_600/xxqti8eli5h2f4abpiz2.jpg
http://images.XXX.com/image/upload/s--_3R1kbWq--/c_limit,cs_srgb,h_600,w_600/lvfdpujvgkf75ve8ikob.jpg

推荐答案

由于当您使用正斜杠分隔/分割字符串时,图像始终是字符串的最后一块,因此可以使用很小的UDF来实现功能.

Since the image is always the last chunk of your string when you separate/split the string by a forward slash, you can use a really tiny UDF to get this functionality.

在新的VBE模块(Alt + F11,然后右键单击您的工作簿并插入>>模块)中,粘贴以下内容:

In a new VBE Module (Alt+F11, then right click your workbook and Insert>>Module), paste the following:

Function get_image(url As String) As String
    'extract the last token from the url when it is split by forward slash
    get_image = Split(url, "/")(UBound(Split(url, "/")))
End Function

现在您可以在工作表中使用此新功能:

Now you can use this new function in your worksheet:

这篇关于在单独的列中需要Excel公式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆