+ Reply to Thread
Results 1 to 4 of 4

Find Value and replace with value in cell A:1

  1. #1
    Registered User
    Join Date
    08-26-2016
    Location
    London
    MS-Off Ver
    2010
    Posts
    26

    Find Value and replace with value in cell A:1

    Hello! I am new to VBA and I would appreciate some help, I have been searching online but cant find a solution to my problem.

    I currently have a working VBA code which finds and replaces the word "Business" with "Manchester United FC":


    Worksheets("Sheet1").Columns("J").Replace _
    What:="Business", Replacement:="Manchester United FC", _
    SearchOrder:=xlByColumns, MatchCase:=True


    But what I really want is Excel to get thereplacing value "Manchester United FC" from cell A:1, that way anytime someone changes A:1 to a different business, I wont have to go in and change the macro code.

    I have tried:



    Worksheets("Sheet1").Columns("J").Replace _
    What:="Business", Replacement:= Range.("A:1").select _
    SearchOrder:=xlByColumns, MatchCase:=True




    But it does not work. Does anyone have a way around this? Thank you!

  2. #2
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Find Value and replace with value in cell A:1

    Try this:
    What:="Business", Replacement:= Range.("A1")
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

  3. #3
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Find Value and replace with value in cell A:1

    Hi,

    Use a variable. i.e.

    Please Login or Register  to view this content.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  4. #4
    Registered User
    Join Date
    08-26-2016
    Location
    London
    MS-Off Ver
    2010
    Posts
    26

    Re: Find Value and replace with value in cell A:1

    Thank you so much, it works perfectly!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 16
    Last Post: 12-02-2014, 03:38 PM
  2. How to find x in all ws _ replace x by value at cell B in same row then sum each row
    By tuongtu3 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-17-2014, 03:09 AM
  3. Find and replace but replace value of cell 3 columns along
    By batchjb69 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-05-2014, 10:57 AM
  4. [SOLVED] Find the Last Cell in a Row and Replace the value
    By A_K in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-29-2013, 03:45 PM
  5. Find value from one cell and replace to another
    By akibahoward in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 11-29-2012, 02:54 PM
  6. Find & Replace Whole Cell
    By sethmote in forum Excel General
    Replies: 1
    Last Post: 01-22-2010, 11:58 AM
  7. Find, Replace with and then replace adjacent cell
    By Craig2097 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-18-2009, 12:42 PM

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