Generating links
-
Please help me. Im tring to create a macro which will create a link for me depending upon the values in Column A and Row 2. I have data in the below format. First Row is the header. Code UK DE FR ABC111 ABC222 ABC333 Im looking for something, when macro is run. It should check Column A value and create a link with the text "Link" in against Rows... Like Under "UK" it should generate a link http://www.ABC111UK.uk and and under "DE" it should be http://www.ABC111DE.de and under "FR" it should be http://www.ABC111FR.fr Then it should check for column A Row 3 and do the same thing.. This process should be in loop till we have data in it. Is it possible. Please help. Thanks &
-
Answer:
this worked for me: Note that at the beginning it deletes any existing hyperlinks in the Activesheet. This is for convenience. You can remove those lines if your don't need them. Sub AddHyperlinks() Dim hlink As Hyperlink Dim r As Range Dim cell As Range Dim i As Long ' clear existing hyperlinks For Each hlink In ActiveSheet.Hyperlinks hlink.Delete Next ' now add new hyperlinks Set r = Range("A2", Cells(Rows.Count, 1).End(xlUp)) For Each cell In r For i = 1 To 3 ActiveSheet.Hyperlinks.Add Anchor:=Cells(cell.Row, i + 1), Address:= _ "http://www." & cell.Text & Cells(1, i + 1) & "." & Cells(1, i + 1) Next i Next cell End Sub
Miningco.com Visit the source
Related Q & A:
- Where To Post Ad Links For Free?Best solution by bestadboard.com
- What Is Tv Links Eu?Best solution by internetsafetyproject.org
- Is it possible to request Google and Bing/Yahoo to drop the cache of links they have indexed?Best solution by Webmasters
- What is a good way to structure mark-up generating code and avoid the example mess?Best solution by Code Review
- What type of brainstorming most effective in generating new ideas?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.