+ Reply to Thread
Results 1 to 6 of 6

Macro to replace text in column and transfer

  1. #1
    Forum Contributor
    Join Date
    01-28-2010
    Location
    NY
    MS-Off Ver
    Excel 2003
    Posts
    105

    Macro to replace text in column and transfer

    Hi, I have the following issue I need help with:

    In Column A, If a cell is ="Investor", Replace the cell with "Holder"
    In that same row, go to column D (replace that specific cell with "% of CSO")
    Next copy that cell and the 20 cells below it in that column, and copy and paste into column C beginning in the same row the first cell of the cells that was copied began in.

    I have included a workbook so its easier to understand with before and after sheets.
    Attached Files Attached Files
    Last edited by undergraduate; 01-12-2011 at 08:38 PM.

  2. #2
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: Macro to replace text in column and transfer

    undergraduate,

    Detach/open workbook undergraduate - EF759669 - VP - SDG12.xls and run macro FindInvestor.
    Attached Files Attached Files
    Have a great day,
    Stan

    Windows 10, Excel 2007, on a PC.

    If you are satisfied with the solution(s) provided, please mark your thread as Solved by clicking EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.

  3. #3
    Forum Contributor
    Join Date
    01-28-2010
    Location
    NY
    MS-Off Ver
    Excel 2003
    Posts
    105

    Re: Macro to replace text in column and transfer

    Thank you alot.

    I have added some code to allow it to run on all worksheets in my workbook.
    However it is giving me an error "Method Range of Object Global failed, error 1004".This is because in some of the sheets there is no word "investor" in Column 1. Is there a way to prevent this error from coming up?



    Please Login or Register  to view this content.

  4. #4
    Forum Contributor
    Join Date
    01-28-2010
    Location
    NY
    MS-Off Ver
    Excel 2003
    Posts
    105

    Re: Macro to replace text in column and transfer

    Hi, so I was able to fix that aspect of the above code. Thank You. It runs on all worksheets
    However I keep getting a runtime error 91 : Object variable or with block variable not set
    Wondering how best to fix this

    Please Login or Register  to view this content.
    Last edited by undergraduate; 01-12-2011 at 12:07 PM. Reason: Object variable or with block variable not set

  5. #5
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: Macro to replace text in column and transfer

    undergraduate,

    Try:

    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    01-28-2010
    Location
    NY
    MS-Off Ver
    Excel 2003
    Posts
    105

    Re: Macro to replace text in column and transfer

    Thanks alot I really appreciate it Stan!

+ 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