+ Reply to Thread
Results 1 to 7 of 7

Removing a space in two different spots in a formula

  1. #1
    Registered User
    Join Date
    10-03-2012
    Location
    Jeffersonville, Indiana
    MS-Off Ver
    Excel 2007, 2010
    Posts
    8

    Removing a space in two different spots in a formula

    I have the following formula:
    ='C:\Documents and Settings\...\[trend (1).xls]trend (1)'! I have 50 worksheets I am linking to so I am having to change them as follows:

    [trend (2).xls]trend (2)'! through [trend (47).xls]trend (47)'!

    I am having to use the 'Ctrl +"F"' and replace option one by one per each worksheet (50 total worksheets per each workbook):
    ='C:\Documents and Settings\...\[trend(1).xls]trend(1)'!

    removing the space between "trend (" in both spots.

    Is there a faster way to replace all spaces in the entire workbook instead of one by one per each worksheet.

    This includes counting up per the next worksheet. trend(1), trend(2), trend(3), ... trend(47).

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,945

    Re: Removing a space in two different spots in a formula

    trying to understand here. so you want
    ='C:\Documents and Settings\...\[trend (1).xls]trend (1)'!
    to be
    ='C:\Documents and Settings\...\[trend(1).xls]trend(1)'!
    ?

    or are you trying to change
    ='C:\Documents and Settings\...\[trend (1).xls]trend (1)'!
    to
    ='C:\Documents and Settings\...\[trend (2).xls]trend (2)'!
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    10-03-2012
    Location
    Jeffersonville, Indiana
    MS-Off Ver
    Excel 2007, 2010
    Posts
    8

    Re: Removing a space in two different spots in a formula

    Replacing trend (1) with trend(1) twice in the same command.

    then go to the next worksheet in the workbook.

    and replacing trend (2) with trend(2).

    etc..

    trend (47) with trend(47)

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,945

    Re: Removing a space in two different spots in a formula

    without knowing what the rest of your formula is, here's a suggestion to play around with.

    replace your entire formula with something like this. i didnt put the full path in, that wont work for me unless i have that file, so play around with adding that into your formula and copy it down...

    =INDIRECT("'Sheet"&ROW(B2)&"'!"&"A"&ROW($A$1))

  5. #5
    Registered User
    Join Date
    10-03-2012
    Location
    Jeffersonville, Indiana
    MS-Off Ver
    Excel 2007, 2010
    Posts
    8

    Re: Removing a space in two different spots in a formula

    Thanks when I receive more data to update my files I will try this and send you an example sheet.

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Removing a space in two different spots in a formula

    Ctrl+F, click Options, Within: Workbook, replace trend ( with trend(, Replace All
    Entia non sunt multiplicanda sine necessitate

  7. #7
    Registered User
    Join Date
    10-03-2012
    Location
    Jeffersonville, Indiana
    MS-Off Ver
    Excel 2007, 2010
    Posts
    8

    Re: Removing a space in two different spots in a formula

    I have been using the 'Ctrl' + "F" function and replace. However it is a link to another worksheet. so if I try to just replace the space it will break the link.
    I think the best way to do this is to remove the "=" from the commmand line =C://.../ and then replace the 2 spaces from the string and then add the "=" back in after ther spaces are removed..

    I will try both this option and FDibbins =INDIRECT("'Sheet"&ROW(B2)&"'!"&"A"&ROW($A$1)) and let everyone know how it goes.

    Thanks!!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1