Loading...

excel-macros@googlegroups.com

[Prev] Thread [Next]  |  [Prev] Date [Next]

Re: $$Excel-Macros$$ How to modify code to display .PDF & .TIF file types as hyperlinks in Excel 2010 instead of just .PDF files. Dave Tue Feb 21 07:02:27 2012

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" <[EMAIL PROTECTED]> 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
> [EMAIL PROTECTED]
>
>
>
> -----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 [EMAIL PROTECTED] 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 [EMAIL PROTECTED]