Hello,
I don't knowmuch about VBA but searching on the internet I could find some macros that help me do what I need.
I have a power query bringing some emails to my sheet, I need to have the sheet refreshed every minute and the native function in excel does not work when more than one person is editing the sheet.
I foun this code, implemented it and it works very well:
Sub Main()
ActiveWorkbook.RefreshAll
Call Refresh_Macro
End Sub
------------------------------------------------------------
Private Sub Refresh_Macro()
Application.OnTime Now + TimeSerial(0, 1, 30), "Main"
End Sub
Now I also need to have a collumn that comes from the query with some urls to be clickable hyperlinks and the HYPERLINK function does not work because the urls are longer than 255 characters. Then I found the following code which also works:
Sub HyperAdd()
For Each xCell In Range("i2", Range("i2").End(xlDown))
ActiveSheet.Hyperlinks.Add Anchor:=xCell, Address:=xCell.Formula, TextToDisplay:="Job"
Next xCell
End Sub
It happens that every time that the query updates I loose the hyperlinks.
What I'm trying to do is to insert the HyperAdd macro inside the loop so everytime that the sheet is updated the refered column will become hyperlinks again.
I have already tried but my VBA knowledge is really limited.
How can I managed to make this work?
I don't knowmuch about VBA but searching on the internet I could find some macros that help me do what I need.
I have a power query bringing some emails to my sheet, I need to have the sheet refreshed every minute and the native function in excel does not work when more than one person is editing the sheet.
I foun this code, implemented it and it works very well:
Sub Main()
ActiveWorkbook.RefreshAll
Call Refresh_Macro
End Sub
------------------------------------------------------------
Private Sub Refresh_Macro()
Application.OnTime Now + TimeSerial(0, 1, 30), "Main"
End Sub
Now I also need to have a collumn that comes from the query with some urls to be clickable hyperlinks and the HYPERLINK function does not work because the urls are longer than 255 characters. Then I found the following code which also works:
Sub HyperAdd()
For Each xCell In Range("i2", Range("i2").End(xlDown))
ActiveSheet.Hyperlinks.Add Anchor:=xCell, Address:=xCell.Formula, TextToDisplay:="Job"
Next xCell
End Sub
It happens that every time that the query updates I loose the hyperlinks.
What I'm trying to do is to insert the HyperAdd macro inside the loop so everytime that the sheet is updated the refered column will become hyperlinks again.
I have already tried but my VBA knowledge is really limited.
How can I managed to make this work?