vba excel code followhyperlink : I have excel, containing **cell A1 as c:\user\download** and **cell A2 contains c:\user** and **cell A3 contains c:\**.

Where i used the coding as follows :

Sub opendfolder()

Dim myfolder As String, nextfolder as string, nextfolder1 as string

myfolder = Range("a1").Value

ActiveWorkbook.FollowHyperlink myfolder

nextfolder = range("a2").value

ActiveWorkbook.FollowHyperlink nextfolder


nextfolder1 = range("a3").value

ActiveWorkbook.FollowHyperlink nextfolder1

End Sub

but my problem is now is that vba code should execute to check first the cell a1,if it got error then goto cell a2 and so on...

**And one more** if vba code able to execute at cell a1 level only then there is no need to execute next cells a2 or a3. Now the coding which i have written is executing all the three.

Can you help me writing the code which will be execute at cell a1, if a1 fails then go to a2. if cell a2 is able to execute successfully then it should not execute to code at cell a3. the code should stop at cell a2.

If fails at a2 cell, then it should try for cell a3.


Please help me....I was not able to get the logic..
how to write a code in the above scenario.

Looking for the reply...asap.....

