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
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
formula version:
=MID(A1,FIND("}}}",SUBSTITUTE(A1,"/","}}}",LEN(A1)-LEN(SUBSTITUTE(A1,"/",""))))+1,LEN(A1))
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.
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:
Related
I´m using an Excel workbook with a custom formula for taking a value from the previous worksheet. I use this formula like INDIRECT(SHEETNAME(SHEET(A1)-1)&"!A1"), so SHEET(A1) returns the current sheet number, and SHEETNAME(SHEET(A1)-1) returns the name of the previous sheet, then I use INDIRECT to take the value A1 from that previous sheet.
Here is the code for the custom sheetname formula:
Function SHEETNAME(number As Long) As String
SHEETNAME = Sheets(number).Name
End Function
The problem is that when I use other workbook at the same time, the mentioned command returns #VALUE!.
Thanks for the help! :)
You should always fully qualify.
So instead of Sheets(number).Name, try ThisWorkbook.Sheets(number).Name
Not doing so can lead to bugs that are difficult to diagnose.
I would always suggest avoiding "ActiveWorkbook" unless you specifically need it.
Could someone please tell me what's wrong with this formula ?
=CONCATENATE(=LEFT(CELL("filename",A1),FIND("[",CELL("filename",A1))-1),"GroupFolder\fileName.png")
Why doesn't the concatenation formula accept the first argument to be an input even though it returns a string?
I'm trying to get the path of a certain file inside the directory of the excel document.
I see no problem with this except a minor typo. Just remove the = sign before the LEFT function. In addition, please take note that CELL function will return nothing if your worksheet is unsaved. So, save your worksheet first.
=CONCATENATE(LEFT(CELL("filename",A1),FIND("[",CELL("filename",A1))-1),"GroupFolder\fileName.png")
Hope this helps..
I'm trying to create a macro that fetch for specific DATA in URL from Excel sheet and when the DATA is found , it copy the values and past it into the Excel File andmove on to the next DATA
I'm a little bit new with SCRAPPING WEB via EXCEL VBA so Anyone can light me and helps me to carry on ?
I made a lot of searches here in stack over flow but I didn't understand too much
I will explain below with Image what I want to Do and I will show My code which is nothing :(
First URL to use to access to MP :http://XXXX-XXXXX.eu.airbus.XXXX:XXXXX/XXXX/consultation/preSearchMP.do?clearBackList=true&CMH_NO_STORING_fromMenu=true
then Take a value from EXCEL FILE and put it in that Path to make search and tape enter
The last Picture IT will loop for MOD and Copy Value and Paste it into Excel File
Can Anyone guide me please with something
this is my first Code
Dim str As String: str = ThisWorkbook.Sheets("Feuil1").Range("A1").Value
Dim myURL as String
' The & symbol concatenates strings. The _ symbol is for line continuation.
myURL =
"http://Confidential.eu.airbus.Confidential:Confidential/Confidential/" _
& "consultation/preViewMP.do?" & str
If you have your URL then the next stage is to send it. To send it you need something to act as a connector, like Internet Explorer, or a background connector without the browser like XMLHttpServer objects - THIS is a good guide to hopefully get you started.
I want to change text direction in a cell from left-to-right to right-to-left using vb code.
Can any one guide me to do that?
thanks.
It is easy, you just need to create a Function in Excel with the following code:
Function Reversestr(str As String) As String
Reversestr = StrReverse(Trim(str))
End Function
Then just use the function inside a cell like
=Reversestr("Text you want to reverse")
I am trying to make a customer link by concatenating two cells containing parts of the URL string, but for some reason it is not working.
These are the strings:
A1:
https://www.correosexpress.com/web/correosexpress/envios4?p_p_id=chxseguimientoEnviosPublico_WAR_chxseguimientoEnviosPublicoportlet&_chxseguimientoEnviosPublico_WAR_chxseguimientoEnviosPublicoportlet_struts.portlet.action=/view/getShippingPublic_execute&_chxseguimientoEnviosPublico_WAR_chxseguimientoEnviosPublicoportlet_shippingNumber=
A2:
(Number we will add in each custom link)
A3: &_chxseguimientoEnviosPublico_WAR_chxseguimientoEnviosPublicoportlet_zipCode=
A4: (number we will add in each customer link)
I am trying the following and receiving an error every time:
=HYPERLINK(CONCATENATE(A1:A2:A3:A4);[LINK])
I tried adding text instead of A1 but the string is too long (more than 255 characters).
I have hit the 255 character limit several times, and unfortunately there is no way around it. You can work around this with VBA, or you can shorten the url in A1 using something like goo.gl url shortener, and then concatenate.
Try this instead:
=HYPERLINK("CONCATENATE(A1,A2,A3,A4)","[LINK]")
NOTE: I put commas instead of colons and semicolons, but you may need to change them back where you are.
I needed to send some data to a PHP-Script and i needed to work on windows and osx.
After some reasearch and trying i ended up with this visual basic function:
Sub SendImportData()
Dim URL As String
URL = "https://example.com/import.php?" & Range("M1").Value
Open "temporary.url" For Output As #1
Print #1, "[InternetShortcut]"
Print #1, "URL=" & URL
Close #1
Shell "temporary.url"
End Sub
Then i built the querystring in excel itself (M1). But you can also built it within visual basic. This will give you more flexibility.
I also want to mention that you need to url-encode the values in your querystring.
There is still a limit of how long a url can be in different browsers. But its much higher than the excel limit.
Hope i could help someone.