+ Reply to Thread
Results 1 to 6 of 6

Replacing part of formula in many cells with VBA

  1. #1
    Forum Contributor
    Join Date
    07-30-2012
    Location
    Leeds
    MS-Off Ver
    Excel 2013
    Posts
    177

    Replacing part of formula in many cells with VBA

    Hello all,
    I need to replace the following part of a formula:
    Please Login or Register  to view this content.
    With this:
    Please Login or Register  to view this content.
    This is part of a larger formula:
    Please Login or Register  to view this content.
    where B5 changes based on the row/column.
    • Actually I only really need to change the vlookup from column 3 to column 5.
    • Alongside this I also need to change the text "KS2Av" to "KS3Av"
    • I need this to happen in range A:AJ, rows 8,16,27,35 all in sheet "Seating Plan" (ranges: A8:AJ8, A16:AJ16, A27:AJ27, A35:AJ35)

    I then need vba to do the reverse, so that I can set the button up to show KS2Av on one click, show KS3Av on other click. I can't upload the file as it contains confidential data.

    Your help is greatly appreciated! Luke

  2. #2
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Replacing part of formula in many cells with VBA

    What about using the Find & replace Dialogue box?


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  3. #3
    Forum Contributor
    Join Date
    07-30-2012
    Location
    Leeds
    MS-Off Ver
    Excel 2013
    Posts
    177

    Re: Replacing part of formula in many cells with VBA

    I need it to be automated because it will be used by non-excel'ing staff

  4. #4
    Valued Forum Contributor tehneXus's Avatar
    Join Date
    04-12-2013
    Location
    Hamburg, Germany
    MS-Off Ver
    Work: MS-Office 2010 32bit @ Win8 32bit / Home: MS-Office 2016 32bit @ Win10 64bit
    Posts
    944

    Re: Replacing part of formula in many cells with VBA

    This might help: http://msdn.microsoft.com/en-us/libr.../ff194086.aspx
    let me know if this does not help you.
    Regards
    Please use [CODE]-TAGS
    When your problem is solved mark the thread SOLVED
    If an answer has helped you please click to give reputation
    Read the FORUM RULES

  5. #5
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Replacing part of formula in many cells with VBA

    Not sure I understand, but this may help to get you started?

    Please Login or Register  to view this content.

  6. #6
    Valued Forum Contributor tehneXus's Avatar
    Join Date
    04-12-2013
    Location
    Hamburg, Germany
    MS-Off Ver
    Work: MS-Office 2010 32bit @ Win8 32bit / Home: MS-Office 2016 32bit @ Win10 64bit
    Posts
    944

    Re: Replacing part of formula in many cells with VBA

    Hi,

    this is replacing as you required in Post#1:
    Please Login or Register  to view this content.
    in column A

    regards

+ 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