Thank Ashish & Don for saving the day & my hide!! On Feb 21, 10:27 am, ashish koul <koul.ash...@gmail.com> wrote: > If Right(f.Name, 4) = ".pdf" OR If Right(f.Name, 4) = ".tif" Then do not > use ( OR If ) > > *try this * > > If Right(f.Name, 4) = ".pdf" OR Right(f.Name, 4) = ".tif" Then > > Download Free Excel > Addin<http://www.excelvbamacros.com/2012/01/my-menu-functions-and-help.html> > > > > > > On Tue, Feb 21, 2012 at 8:37 PM, Dave <davidstev...@gmail.com> wrote: > > Thanks Don I tried it and its giving me a Syntax error. here is the > > line as I have it in the code. > > > If Right(f.Name, 4) = ".pdf" OR If Right(f.Name, 4) = ".tif" Then > > > On Feb 21, 8:37 am, "dguillett1" <dguille...@gmail.com> wrote: > > > I would probably write this differently but try this > > > > If Right(f.Name, 4) = ".pdf" ORIf Right(f.Name, 4) = ".tif" Then > > > > Don Guillett > > > SalesAid Software > > > dguille...@gmail.com > > > > -----Original Message----- > > > From: Dave > > > Sent: Tuesday, February 21, 2012 8:26 AM > > > To: MS EXCEL AND VBA MACROS > > > Subject: $$Excel-Macros$$ How to modify code to display .PDF & .TIF file > > > types as hyperlinks in Excel 2010 instead of just .PDF files. > > > > Hi, > > > > I have the following code which searches a folder and than displays > > > all the .PDF files as hyperlinks in the body of the Excel > > > spreadhsheet. I want to modify it so that it can display .TIF files > > > also. Can you please look at the code below and see if this can be > > > done. All help is appreciated. > > > > Private Sub FolderRead(ByRef myFolder) > > > Dim countf As String > > > countf = 0 > > > For Each f In myFolder.Files > > > Var = f.Path > > > If Right(f.Name, 4) = ".pdf" Then > > > i = i + 1 > > > ActiveSheet.Hyperlinks.Add Anchor:=Range("A" & i), _ > > > Address:=f.Path, TextToDisplay:=f.Name & " " & f > > > > Range("I" & i) = f.Name 'mer added > > > Range("J" & i) = rootfolder & "\" 'mer added > > > countf = countf + 1 > > > End If > > > > Next f > > > Range("E1") = "# Of Documents is: " & countf > > > countf = 0 > > > End Sub > > > > -- > > > FORUM RULES (986+ members already BANNED for violation) > > > > 1) Use concise, accurate thread titles. Poor thread titles, like Please > > > Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice > > will > > > not get quick attention or may not be answered. > > > > 2) Don't post a question in the thread of another member. > > > > 3) Don't post questions regarding breaking or bypassing any security > > > measure. > > > > 4) Acknowledge the responses you receive, good or bad. > > > > 5) Cross-promotion of, or links to, forums competitive to this forum in > > > signatures are prohibited. > > > > NOTE : Don't ever post personal or confidential data in a workbook. > > Forum > > > owners and members are not responsible for any loss. > > > ------------------------------------------------------------------------------------------------------ > > > To post to this group, send email to excel-mac...@googlegroups.com-Hide > > > quoted text - > > > > - Show quoted text - > > > -- > > FORUM RULES (986+ members already BANNED for violation) > > > 1) Use concise, accurate thread titles. Poor thread titles, like Please > > Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice > > will not get quick attention or may not be answered. > > > 2) Don't post a question in the thread of another member. > > > 3) Don't post questions regarding breaking or bypassing any security > > measure. > > > 4) Acknowledge the responses you receive, good or bad. > > > 5) Cross-promotion of, or links to, forums competitive to this forum in > > signatures are prohibited. > > > NOTE : Don't ever post personal or confidential data in a workbook. Forum > > owners and members are not responsible for any loss. > > > ------------------------------------------------------------------------------------------------------ > > To post to this group, send email to excel-macros@googlegroups.com > > -- > *Regards* > * * > *Ashish Koul* > *http://www.excelvbamacros.com/* > *http://www.accessvbamacros.com/*<http://www.accessvbamacros.com/> > > P Before printing, think about the environment.- Hide quoted text - > > - Show quoted text -
-- FORUM RULES (986+ members already BANNED for violation) 1) Use concise, accurate thread titles. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get quick attention or may not be answered. 2) Don't post a question in the thread of another member. 3) Don't post questions regarding breaking or bypassing any security measure. 4) Acknowledge the responses you receive, good or bad. 5) Cross-promotion of, or links to, forums competitive to this forum in signatures are prohibited. NOTE : Don't ever post personal or confidential data in a workbook. Forum owners and members are not responsible for any loss. ------------------------------------------------------------------------------------------------------ To post to this group, send email to excel-macros@googlegroups.com