+ Reply to Thread
Results 1 to 15 of 15

Find replace using cells own row number

  1. #1
    Forum Expert nigelog's Avatar
    Join Date
    12-14-2007
    Location
    Cork, Ireland
    MS-Off Ver
    Office 365 Windows 10
    Posts
    2,293

    Find replace using cells own row number

    As a quick fix in a larger macro I am trying to replace the carried over "=#REF!*F and its its row number" with "D and its row number * F and and its row number"
    I tried this but it gives a static reference to whatever cell is selected at the time

    Please Login or Register  to view this content.
    Any help appreciated
    Last edited by nigelog; 02-23-2018 at 08:06 AM.

  2. #2
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Find replace using cells own row number

    If you are simply replacing the F with a D
    Try this one-liner

    Please Login or Register  to view this content.

    I was not sure what the * meant - is it used as a wildcard or is it a character in the cell?
    - if that causes solution not to give you what you want, then I need to know more about the original values
    Click *Add Reputation to thank those who helped you. Ask if anything is not clear

  3. #3
    Forum Expert nigelog's Avatar
    Join Date
    12-14-2007
    Location
    Cork, Ireland
    MS-Off Ver
    Office 365 Windows 10
    Posts
    2,293

    Re: Find replace using cells own row number

    Hi Kev

    a formula paste gives a reference error because the column carried to another sheet moves position

    result
    Please Login or Register  to view this content.
    when the preferred result would be
    Please Login or Register  to view this content.

  4. #4
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Find replace using cells own row number

    Do all the cells in the column have the problem or only some of them?

  5. #5
    Forum Expert nigelog's Avatar
    Join Date
    12-14-2007
    Location
    Cork, Ireland
    MS-Off Ver
    Office 365 Windows 10
    Posts
    2,293

    Re: Find replace using cells own row number

    Some have a formula which is correct these cells do not

  6. #6
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Find replace using cells own row number

    I would like to see the actual formulas etc
    Can you post sample workbook

    Click GoAdvanced \ look below and click on ManageAttachments \ follow screen instructions

  7. #7
    Forum Expert
    Join Date
    10-06-2017
    Location
    drevni ruchadlo
    MS-Off Ver
    old
    Posts
    2,266

    Re: Find replace using cells own row number

    Quote Originally Posted by nigelog View Post
    Please Login or Register  to view this content.
    "Selection.Row" - works every time I try, and this "Selection.Cells(1).Row" also, while "Replace" does not work from the vba level.

  8. #8
    Forum Expert nigelog's Avatar
    Join Date
    12-14-2007
    Location
    Cork, Ireland
    MS-Off Ver
    Office 365 Windows 10
    Posts
    2,293

    Re: Find replace using cells own row number

    Storm08's workbook I was assisting with - need to carry formulas to sheet2

    right click to see control menu

    client update refers to Module7.CopyRows
    Attached Files Attached Files

  9. #9
    Forum Expert
    Join Date
    10-06-2017
    Location
    drevni ruchadlo
    MS-Off Ver
    old
    Posts
    2,266

    Re: Find replace using cells own row number

    "ReplaceText" is reserved word in vba ... Read/write Boolean.

    Edit:

    Maybe something like that ?
    Please Login or Register  to view this content.
    Last edited by mjr veverka; 02-23-2018 at 07:56 AM.

  10. #10
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Find replace using cells own row number

    You will need to refer to the correct worksheet.

    Please Login or Register  to view this content.

  11. #11
    Forum Expert nigelog's Avatar
    Join Date
    12-14-2007
    Location
    Cork, Ireland
    MS-Off Ver
    Office 365 Windows 10
    Posts
    2,293

    Re: Find replace using cells own row number

    Perfect much appreciated Kev

  12. #12
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Find replace using cells own row number

    You are welcome

    Another way is to replace the formula itself
    Please Login or Register  to view this content.

  13. #13
    Forum Expert nigelog's Avatar
    Join Date
    12-14-2007
    Location
    Cork, Ireland
    MS-Off Ver
    Office 365 Windows 10
    Posts
    2,293

    Re: Find replace using cells own row number

    The last issue is using the "sumbycolor" function to sum the cells

    Ive tried replacing the formula in the cell
    Please Login or Register  to view this content.
    but no joy

  14. #14
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Find replace using cells own row number

    I do not know what the function demands, but( based on your post)
    this:
    Please Login or Register  to view this content.
    will give you this formula in the cell [if lastRow = 20] :
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Edit1
    The formula box is playing up (on my PC at least) - formula returned is:
    =SumByColor(G10, G10:G18)

    Edit2
    The formula box is not playing up 30 minutes later
    Last edited by kev_; 02-23-2018 at 09:44 AM.

  15. #15
    Forum Expert nigelog's Avatar
    Join Date
    12-14-2007
    Location
    Cork, Ireland
    MS-Off Ver
    Office 365 Windows 10
    Posts
    2,293

    Re: Find replace using cells own row number

    Spot on Kev

    works a treat

    Thanks a lot

+ 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. Find and replace number over 3
    By KTM450 in forum Excel General
    Replies: 5
    Last Post: 05-21-2015, 07:42 PM
  2. [SOLVED] Replace blank cells with ZERO using Find Replace
    By makinmomb in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-25-2014, 04:47 PM
  3. [SOLVED] Find and replace on the 1st few number with zero
    By cks1026 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 07-01-2013, 03:07 AM
  4. Find a number and replace the adjacent cell with other number
    By shafath03 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-20-2013, 09:09 PM
  5. Find any number, but don't replace
    By Johnf42 in forum Excel General
    Replies: 3
    Last Post: 09-14-2009, 08:23 PM
  6. Find, and replace but copy cells before replace
    By raehippychick in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-05-2007, 08:16 AM
  7. Find Replace Number Starting with 0
    By Amir in forum Excel General
    Replies: 0
    Last Post: 11-10-2005, 01:15 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