Results 1 to 4 of 4

Search for text and edit neighbouring cell

Threaded View

graveaj1 Search for text and edit... 06-28-2017, 08:12 AM
jindon Re: Search for text and edit... 06-28-2017, 08:20 AM
graveaj1 Re: Search for text and edit... 06-28-2017, 08:23 AM
jindon Re: Search for text and edit... 06-28-2017, 08:26 AM
  1. #1
    Registered User
    Join Date
    06-28-2017
    Location
    UK
    MS-Off Ver
    2007
    Posts
    2

    Search for text and edit neighbouring cell

    I've been struggling with this one for a while now, having read several posts on here but can't seem to make it work.

    I've got a workbook with several sheets, each of them containing a 'revision number' cell at different locations (e.g. cell X7 contains "Revision:" and cell Y7 the number, e.g. "4"). I'd like to write a macro that searches for the word "Revision:" and adds 1 to the value in the neighbouring cell. So far I've tried the code below, but get the error "Run-time error '13': Type mismatch." What am I doing wrong?

    Thanks!
    Sub RevNumbers()
        
    For Each WS In ActiveWorkbook.Worksheets
        For Each C In WS.Range("A:Z")
            If C.Value = "Revision:" Then
                C.Offset(0, 1).FormulaR1C1 = C.Offset(0, 1).Value + 1
            End If
        Next C
    Next WS
        
    End Sub
    Last edited by graveaj1; 06-28-2017 at 09:47 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Sumproduct of column based on text search of neighbouring column
    By anthropormorph in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-01-2015, 10:51 AM
  2. Auotmatic highlighting of a neighbouring cell
    By Andy Robertshawe in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 05-27-2014, 05:20 PM
  3. [SOLVED] How to add up cells in a row based on criteria in neighbouring cell
    By bigbrain in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 08-30-2013, 05:55 PM
  4. score explanation in the neighbouring cell
    By polomacnenad in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 02-10-2012, 11:52 AM
  5. macro - search within a cell and edit the text string
    By filo.soph in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-21-2011, 09:19 AM
  6. transferring comments to a neighbouring cell
    By keyes in forum Excel General
    Replies: 3
    Last Post: 09-16-2008, 05:26 PM
  7. Search and Edit cell contents
    By Zooropa in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-26-2006, 04:34 AM

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