Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default If extension of a path in a cell is .pdf then

Hello

Was wondering how to go about this. I have a bunch of file paths all
in column E. I wanted to generate either "External" or "Internal"
into column F depending on whether the file extension is .pdf
or .html.

Any ideas?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 141
Default If extension of a path in a cell is .pdf then

On Apr 30, 10:49*am, Mark wrote:
Hello

Was wondering how to go about this. *I have a bunch of file paths all
in column E. *I wanted to generate either "External" or "Internal"
into column F depending on whether the file extension is .pdf
or .html.

Any ideas?


=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?

HTH

Chris
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default If extension of a path in a cell is .pdf then

On Apr 30, 10:02*am, cht13er wrote:
On Apr 30, 10:49*am, Mark wrote:

Hello


Was wondering how to go about this. *I have a bunch of file paths all
in column E. *I wanted to generate either "External" or "Internal"
into column F depending on whether the file extension is .pdf
or .html.


Any ideas?


=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?

HTH

Chris


Oh do I just use this as a function for column F?
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default If extension of a path in a cell is .pdf then

On Apr 30, 10:31*am, Mark wrote:
On Apr 30, 10:02*am, cht13er wrote:





On Apr 30, 10:49*am, Mark wrote:


Hello


Was wondering how to go about this. *I have a bunch of file paths all
in column E. *I wanted to generate either "External" or "Internal"
into column F depending on whether the file extension is .pdf
or .html.


Any ideas?


=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?


HTH


Chris


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...
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default If extension of a path in a cell is .pdf then

=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



  #6   Report Post  
Posted to microsoft.public.excel.programming
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.
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default If extension of a path in a cell is .pdf then

The formula I posted does work correctly here on my system. Try selecting
Column F and hitting the Delete button (better might be Edit/Clear/All) to
clear the cells in the column, then paste the last formula I posted back
into F2 again and try copying it down to see if that works for you.

Rick


"Mark" wrote in message
...
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.

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default If extension of a path in a cell is .pdf then

On Apr 30, 12:49*pm, "Rick Rothstein \(MVP - VB\)"
wrote:
The formula I posted does work correctly here on my system. Try selecting
Column F and hitting the Delete button (better might be Edit/Clear/All) to
clear the cells in the column, then paste the last formula I posted back
into F2 again and try copying it down to see if that works for you.

Rick

"Mark" wrote in message

...
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.- Hide quoted text -

- Show quoted text -


I think the reason its not working for me is because everything else
in the spreadsheet is being generated by VBA? I even created a new
xls spreadsheet and entered .pdf's and .html's but it always remains
the same for me when I drag the copy over the cells.
  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 141
Default If extension of a path in a cell is .pdf then

On Apr 30, 3:22*pm, Mark wrote:
On Apr 30, 12:49*pm, "Rick Rothstein \(MVP - VB\)"





wrote:
The formula I posted does work correctly here on my system. Try selecting
Column F and hitting the Delete button (better might be Edit/Clear/All) to
clear the cells in the column, then paste the last formula I posted back
into F2 again and try copying it down to see if that works for you.


Rick


"Mark" wrote in message


...
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.- Hide quoted text -


- Show quoted text -


I think the reason its not working for me is because everything else
in the spreadsheet is being generated by VBA? *I even created a new
xls spreadsheet and entered .pdf's and .html's but it always remains
the same for me when I drag the copy over the cells.- Hide quoted text -

- Show quoted text -


Hit F9 (forces a calculation) .. .and check that you aren't turning
calculations off in your code.

HTH

Chris
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Insert file name in cell without .xls extension Steve Excel Discussion (Misc queries) 8 April 3rd 23 04:25 PM
Remove end folder from path found with ThisWorkbook.Path command ? dim Excel Programming 9 April 23rd 08 06:04 AM
hyperlink navigation path path wrong in Excel 2003 CE Admin Excel Discussion (Misc queries) 5 January 7th 06 07:47 PM
cell character extension R Smith Excel Worksheet Functions 3 June 15th 05 08:10 AM
Transformation d'images avec une extension .jpg ou .jpeg en images avec extension .bmp ou .ico imej-clavier Excel Discussion (Misc queries) 1 May 28th 05 05:52 PM


All times are GMT +1. The time now is 04:53 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"