View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Mark[_66_] Mark[_66_] is offline
external usenet poster
 
Posts: 24
Default If extension of a path in a cell is .pdf then

On Apr 30, 12:20*pm, "Rick Rothstein \(MVP - VB\)"
wrote:
=IF(RIGHT(E1,3) = "pdf", "External", IF(RIGHT(E1,4) = "html",
"Internal" , "Neither HTML nor PDF"))


Or do you need VBA code for some reason?


Oh do I just use this as a function for column F?- Hide quoted text -


- Show quoted text -


Actually, i modified the function to


=IF(RIGHT(E:E,3) = "pdf", "External", IF(RIGHT(E:E,4) =
"html","Internal", "Neither HTML nor PDF"))


Now, how do I get that function into every cell within column F using
VBA? *If I paste the function into F:2, and then copy it into the rest
of the column, it says the same regardless if internal or external...


The reason it returns the same value is because you modified it incorrectly.
Since you are starting in the second row, put this in F2 and copy it down....

=IF(RIGHT(E2,3)="pdf","External",IF(RIGHT(E2,4)="h tml","Internal","Neither
HTML nor PDF"))

And for future reference, the above is called a formula, not a function
(things like IF and RIGHT are called functions).

Rick- Hide quoted text -

- Show quoted text -


Yea for some reason after I copy it it still doesn't change for me.
The first one in row 2 is internal, and when I copy it they all just
still say internal when some should be external.