Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 10-15-2013, 11:53 AM
jmaxcy jmaxcy is offline Adding additional "\" to directory path name Windows 8 Adding additional "\" to directory path name Office 2010 64bit
Novice
Adding additional "\" to directory path name
 
Join Date: Oct 2013
Posts: 6
jmaxcy is on a distinguished road
Default Adding additional "\" to directory path name

Anyone out there know how to add an additional "\" to a directory path name using a formula?

I am pulling down the current directory path using the =cell("filename",a1) formula. I would like to take this directory path and add an additional "\" to each one in the path name.

For example, i want to take a directory like: C:\desktop\folder name\folder name 2\folder name 3

and make it read as : C:\\desktop\\folder name\\folder name 2\\ folder name 3

I was able to add an additional "\" after the first one only using a REPLACE(g6,find("\",g6),1,"\\").

However, this only takes care of the first "\" and I am not sure how to change the remaining "\"s.

Is there anyway to do this without getting into VBA code?

Much appreciated!
Reply With Quote
  #2  
Old 10-15-2013, 01:42 PM
BobBridges's Avatar
BobBridges BobBridges is offline Adding additional "\" to directory path name Windows 7 64bit Adding additional "\" to directory path name Office 2010 32bit
Expert
 
Join Date: May 2013
Location: USA
Posts: 700
BobBridges has a spectacular aura aboutBobBridges has a spectacular aura about
Default

Isn't there an argument you can supply to the REPLACE function that does it to all occurrences, not just the first one? Let's see.... Nope, guess I just dreamt that. No, wait a minute, here it is; use SUBSTITUTE instead.

SUBSTITUTE(text, old_text, new_text, [instance_num])The SUBSTITUTE function syntax has the following arguments:
  • Text Required. The text or the reference to a cell containing text for which you want to substitute characters.
  • Old_text Required. The text you want to replace.
  • New_text Required. The text you want to replace old_text with.
  • Instance_num Optional. Specifies which occurrence of old_text you want to replace with new_text. If you specify instance_num, only that instance of old_text is replaced. Otherwise, every occurrence of old_text in text is changed to new_text.
Reply With Quote
Reply

Tags
directory name replace, find

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding additional "\" to directory path name "Save as picture" not offering directory eNGiNe Drawing and Graphics 3 02-26-2013 01:48 AM
How to edit the "Format" and the "show level" of an EXISTING table of content? Jamal NUMAN Word 2 08-14-2011 10:46 AM
Adding additional "\" to directory path name How to choose a "List" for certain "Heading" from "Modify" tool? Jamal NUMAN Word 2 07-03-2011 03:11 AM
"Microsoft Excel Application" missing in the "Component Services" on win08 sword.fish Excel 0 02-26-2010 02:09 PM
Adding additional "\" to directory path name word 2002 adding "delete" to drop down 2402RUNE Word 1 12-07-2008 09:29 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 12:32 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft