+ Reply to Thread
Results 1 to 5 of 5

Code to Find and Enter Text into Offset Cell for Multiple Sheets

Hybrid View

Phillycheese5 Code to Find and Enter Text... 03-18-2016, 02:20 PM
daffodil11 Re: Code to Find and Enter... 03-18-2016, 02:41 PM
Phillycheese5 Re: Code to Find and Enter... 03-18-2016, 03:27 PM
AB33 Re: Code to Find and Enter... 03-18-2016, 05:06 PM
Phillycheese5 Re: Code to Find and Enter... 03-18-2016, 07:12 PM
  1. #1
    Forum Contributor
    Join Date
    06-10-2005
    MS-Off Ver
    2007
    Posts
    223

    Code to Find and Enter Text into Offset Cell for Multiple Sheets

    Hi,
    I have a file with 12 sheets, each has a list of sectors and also an "other" category in column A. My goal would be to find where the category is "other" in column A, and to put "no data" into column D. I have tried some code that I found but I cannot make it work without all sorts of errors (so there is no code in the uploaded file).
    Any suggestions would be appreciated.

    Thanks,
    Phillycheese
    Attached Files Attached Files
    Last edited by Phillycheese5; 03-18-2016 at 07:16 PM.

  2. #2
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Code to Find and Enter Text into Offset Cell for Multiple Sheets

    Something like this should be able to accomplish what you're trying to do:

    Sub NoData()
    
    Dim ws As Worksheet
    Dim rngCell As Range
    
    For Each ws In ActiveWorkbook.Worksheets
        For Each rngCell In Range("A1", Range("A" & Rows.Count).End(xlUp))
            If rngCell = "Other" Then rngCell.Offset(, 3) = "no data"
        Next
    Next
    
    End Sub
    This runs through all worksheets in the workbook, and searches from A1 to last populated cell in Column A for the word Other, and then populates the cell 3 columns to the right with 'no data'.
    Make Mom proud: Add to my reputation if I helped out!

    Make the Moderators happy: Mark the Thread as Solved if your question was answered!

  3. #3
    Forum Contributor
    Join Date
    06-10-2005
    MS-Off Ver
    2007
    Posts
    223

    Re: Code to Find and Enter Text into Offset Cell for Multiple Sheets

    Hey Daffodil,
    I put the code in my file and it works great on the first worksheet, but doesn't make changes to the other worksheets. Is there something I need to adjust?

    Thanks,
    Phillycheese

  4. #4
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Code to Find and Enter Text into Offset Cell for Multiple Sheets

    Another option.
    Attached Files Attached Files

  5. #5
    Forum Contributor
    Join Date
    06-10-2005
    MS-Off Ver
    2007
    Posts
    223

    Re: Code to Find and Enter Text into Offset Cell for Multiple Sheets

    Hey AB33,
    Thanks for this! As with all the normal Excel stuff, there's always a few ways of tackling issues! I tested this and it goes through all the sheets which is great.
    Thanks again,
    Phillycheese

+ 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: 5
    Last Post: 02-11-2016, 11:24 AM
  2. Find cell with text, offset to the left one cell and write code
    By timas in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 07-23-2015, 01:22 AM
  3. find value in multiple sheets, copy offset and paste to summary sheet
    By Pholic in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-02-2011, 12:23 PM
  4. code to find text, offset 1 column and paste to new workbook not working
    By trillium in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-10-2011, 07:55 AM
  5. Code To Find and Offset works on first sheet but won't loop to other sheets
    By mgaworecki in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-10-2009, 03:02 PM
  6. Find, copare between 2 sheets and enter data from another cell
    By raehippychick in forum Excel General
    Replies: 6
    Last Post: 05-04-2007, 08:20 AM
  7. Enter Text or Date on Multiple Sheets
    By singh352@hotmail.com in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-09-2005, 04:06 AM

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