Results 1 to 6 of 6

Loop rows and make a Range null if criteria met in defined Column

Threaded View

  1. #1
    Registered User
    Join Date
    01-31-2016
    Location
    Florida, USA
    MS-Off Ver
    13
    Posts
    26

    Loop rows and make a Range null if criteria met in defined Column

    I have this VBA code:

    Sub CleanSheet()
    
        For Counter = 2 To 600
            Set curCell = Worksheets("MY_WORKSHEET").Cells(Counter, 24)
            If (curCell.Value) = "NO" Then Worksheets("MY_WORKSHEET").Range("B2:T2").Value = Null
            
        Next Counter
        
    End Sub
    What I need to do is look at column "X" (Cell Count 24) and make the Range B:T starting at row "2" null if "NO" and then Loop it to the next row and so on and stop at row 600. This code obviously ONLY sees Range("B2:T2") so no matter what ALWAYS Nulls that range.
    How do I change the range to match the current row to match column "X"?
    Last edited by alansidman; 04-03-2016 at 09:18 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. VBA Loop that check cells in a column(Range)then copy if criteria match
    By Eben in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-14-2015, 02:43 AM
  2. Count rows with multiple null and not null criteria
    By carlostheba in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-28-2014, 05:16 AM
  3. [SOLVED] Deleting a range with defined column widths but undefined numbers of rows.
    By moosetales in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 05-18-2014, 05:30 PM
  4. How to make a named range null or empty if count = 0 (no values present)
    By MCunningham in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-15-2013, 12:12 PM
  5. Macro to Insert defined integer into range defined by variable criteria
    By stereofeedback in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-06-2013, 12:33 PM
  6. Macro to hide rows based on defined range in a column
    By derryt in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 03-27-2012, 12:20 PM
  7. Macro, autofilter, delete rows outside date range, defined names as criteria
    By rain4u in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-30-2011, 04:10 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