+ Reply to Thread
Results 1 to 21 of 21

Urgent Help Required! Double string macro to remove the 1st & last part of Forumla

  1. #1
    Registered User
    Join Date
    05-04-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    10

    Urgent Help Required! Double string macro to remove the 1st & last part of Forumla

    Hello!

    Help urgently required!

    I need to amend about 3000 cells on on worksheet to remove the first part of the formula and also the last part of the formula!

    I cant just amend it and drag it down as its pulling from 20 different tabs!!!!!

    Because I will be removing the (())'s Excel's automatic formula checking keeps kicking in on the normal find and replace (with nothing) and trying to auto-fix it for me.

    Is there a way to build a basic macro to remove the desired text from the beginning and end of a formula without it being interrupted by the Excel auto-correction which we have been unable to disable?

    Each cell has different contend in the middle as it is an oracle based application to load data which each cells loads with different dimensions which are being pulled from all over the sheet.

    The formula is posted below and the part I need to remove are coloured in red!

    =IF(G$5="CurFcstBudRate",IF('Fixed Assets'!G99=0,"",HsSetValue('Fixed Assets'!G99,$B$3,"Scenario#"&G$5&";Year#"&$B$5&";Period#"&G$6&";View#<Scenario View>;Entity#"&$B$2&";Value#<Entity Currency>;Account#"&$A100&";ICP#[ICP None];Custom1#"&$B100&";Custom2#[None];Custom3#[None];Custom4#BUManInput")),"")

    Please help today if possible as we have a deadline pending!

    Eternally Great-full!

    Chris!

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Urgent Help Required! Double string macro to remove the 1st & last part of Forumla

    If you remove it and drag down, even if it contains 20 different tabs, wont it work?

    Also, should this 1 formula be edited for all 3000 cells? Are those 3000 cells all in 1 column?
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  3. #3
    Registered User
    Join Date
    05-04-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Urgent Help Required! Double string macro to remove the 1st & last part of Forumla

    Hi Arlette,

    There are about 900 rows and 12 columns each.

    The tabs that they are pulling from are not in order so the middle part of the formula is correct to go to each specific location on that tab but my dragging down it wont pick up the correct data from the desired tab.Spreadsheet example.jpg

  4. #4
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Urgent Help Required! Double string macro to remove the 1st & last part of Forumla

    Instead of a .jpg, please attach a sample excel file. It will help us to work out a faster solution for you.

  5. #5
    Registered User
    Join Date
    05-04-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Urgent Help Required! Double string macro to remove the 1st & last part of Forumla

    Hello,

    Have attached my template,

    it connects to Oracle to retrieve and submit data but you will still be able to see the formula without this connection!

    Thank you
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    05-04-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Urgent Help Required! Double string macro to remove the 1st & last part of Forumla

    BTW G20 on the BS_Fcst_Load has been manually amended so we can see what needs to happen ideally to the rest of the cells!

  7. #7
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Urgent Help Required! Double string macro to remove the 1st & last part of Forumla

    Try this on a copy of your workbook as the results CANNOT be undone.

    Please Login or Register  to view this content.
    Last edited by abousetta; 05-04-2012 at 07:17 AM. Reason: corrected syntax
    Please consider:

    Thanking those who helped you. Click the star icon in the lower left part of the contributor's post and add Reputation.
    Cleaning up when you're done. Mark your thread [SOLVED] if you received your answer.

  8. #8
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Urgent Help Required! Double string macro to remove the 1st & last part of Forumla

    Just tested on your sample and seems to work fine even though it takes a few minutes to run. I have added a few extra lines above to speed things up a bit. Will check back in a few hours to see if it worked for you.

  9. #9
    Registered User
    Join Date
    05-04-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Urgent Help Required! Double string macro to remove the 1st & last part of Forumla

    Hello! Not sure what I am doing wrong to get the "Compile Error, Invalid Outside Procedure"Macro Error.jpg

  10. #10
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Urgent Help Required! Double string macro to remove the 1st & last part of Forumla

    My mistake. I forgot to paste the first line. Add the line:

    Please Login or Register  to view this content.
    at the beginning to the code.

  11. #11
    Registered User
    Join Date
    05-04-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Urgent Help Required! Double string macro to remove the 1st & last part of Forumla

    Thanks for the updated script! I cant seem to get it working! I have amended the macro and ran it which froze up after a short while then after it unfreezes and the bits we wanted to remove are still there Have you still got the file that worked?

  12. #12
    Registered User
    Join Date
    05-04-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Urgent Help Required! Double string macro to remove the 1st & last part of Forumla

    Just tried on another machine also and it just timed out! Any chance we can pinch your test file to copy paste formula?

  13. #13
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Urgent Help Required! Double string macro to remove the 1st & last part of Forumla

    I am rerunning it from work with a few tweaks. Hopefully will get back to you soon.

    abousetta

  14. #14
    Registered User
    Join Date
    05-04-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Urgent Help Required! Double string macro to remove the 1st & last part of Forumla

    Thanks you! Your help is really appriciated!

  15. #15
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Urgent Help Required! Double string macro to remove the 1st & last part of Forumla

    Hi Chris,

    OK, I think this should work now. I tested on a small sample because it keeps asking me for the location of the add-in you have on your system. So I didn't get a chance to run it on the whole workbook, but let me know if still is not working.

    abousetta

    Please Login or Register  to view this content.

  16. #16
    Registered User
    Join Date
    05-04-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Urgent Help Required! Double string macro to remove the 1st & last part of Forumla

    Still doesnt do it! It doesnt time out but leaves the undesired data still! Did your version work? I am still in the office at 9pm trying to get this stubborn template working

  17. #17
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Urgent Help Required! Double string macro to remove the 1st & last part of Forumla

    Have a look at the attachment. Maybe I didn't understand what you were trying to remove correctly.

    abousetta
    Attached Files Attached Files

  18. #18
    Forum Contributor
    Join Date
    01-09-2009
    Location
    Cedar Hill, Tx
    MS-Off Ver
    Excel 2003
    Posts
    200

    Re: Urgent Help Required! Double string macro to remove the 1st & last part of Forumla

    One thing that might help is that the formula checking would be turned off if you changed the Recalc to manual. At least, my quick testing indicated that... Good Luck.

  19. #19
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Urgent Help Required! Double string macro to remove the 1st & last part of Forumla

    Thanks bstubbs. I turned off link updating and that allowed the formulas to be updated. Thanks for the headsup and I will keep this in mind.

  20. #20
    Registered User
    Join Date
    05-04-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Urgent Help Required! Double string macro to remove the 1st & last part of Forumla

    Thank you so much! it worked! You have really really helped me out

  21. #21
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Urgent Help Required! Double string macro to remove the 1st & last part of Forumla

    Glad it all worked out.

    Good luck.

    abousetta

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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