Results 1 to 6 of 6

Looping FindFormat with relative cell update

Threaded View

  1. #1
    Registered User
    Join Date
    10-22-2009
    Location
    Chicago
    MS-Off Ver
    Excel 2007
    Posts
    3

    Question Looping FindFormat with relative cell update

    Using Excel 2007 and VBA code, I am trying to find all cells in a worksheet with a particular number format ("#,##0.00 ""INR"). For each of these cells I would like to update the cell in the column directly to the right with the value "YES". I have recorded a macro to find the correct format and modified my code to change the value of the cell and everything looks great. However, I cannot figure out the correct way to loop through the sheet once and perform the same function for each of the cells matching the format criteria. Any help is appreciated. Below is my code so far:
    ----

    Sub Find_Format_INR()
    '
    ' Find_Format_INR Macro
    '
        
    
        Application.FindFormat.NumberFormat = "#,##0.00 ""INR"""
        Cells.Find(what:="", after:=ActiveCell, LookIn:=xlFormulas, LookAt:= _
            xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False _
            , searchformat:=True).Activate
        ActiveCell.Offset(0, 1).Range("A1").Select
        ActiveCell.FormulaR1C1 = "YES"
        ActiveCell.Offset(0, 1).Range("A1").Select
        
    End Sub
    Last edited by Leith Ross; 10-22-2009 at 02:41 PM. Reason: Added Code Tags

Thread Information

Users Browsing this Thread

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

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