+ Reply to Thread
Results 1 to 1 of 1

blank if the column is empty

Hybrid View

zafirah blank if the column is empty 08-17-2013, 09:02 PM
  1. #1
    Registered User
    Join Date
    05-11-2013
    Location
    singapore
    MS-Off Ver
    Excel 2010
    Posts
    11

    blank if the column is empty

    I have a userform to filter the multiple criteria insteadnof filtering . In another spreadsheet , it needs to set target for particular group. But however when I filter the second time , empty blanks will apppear as empty . Let just say in first selection , 10000 rows appear in column 6 .but when I select again of different option, and 400 data appear , for rows 401-10000 will appear as false. Thanks in advanced .

    Sub Macro1() 
    Dim Row As Integer 
    Dim Blank As Integer 
    
    Row = 2 
    Blank = 0 
    
    With Sheet4 
       Do While Blank <= 5 
          If .Cells(Row, 5).Value = "CAT" Then 
             .Cells(Row, 6).Value = "9" 
             Row = Row + 1 
          ElseIf .Cells(Row, 5).Value = "DOG" Then 
             .Cells(Row, 6).Value = "35" 
             Row = Row + 1 
          ElseIf .Cells(Row, 5).Value = "RABBIT" Then 
             .Cells(Row, 6).Value = "50" 
             Row = Row + 1 
          ElseIf .Cells(Row, 5).Value = "OTTER" Then 
             .Cells(Row, 6).Value = "6" 
             Row = Row + 1 
          Else 
             .Cells(Row, 6).Value = "2" 
             Row = Row + 1 
       End If 
    '--- For detect end of row 
       If .Cells(Row, 5).Value = "" Then 
          Blank = 6 
       Else 
    '--- Reset 
          Blank = 0 
       End If 
    Loop 
    End With 
    
    End Sub
    Last edited by JBeaucaire; 08-17-2013 at 09:49 PM. Reason: Corrected the tags.

+ 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. Copy/Paste to Next Empty Row Overwriting Previous Row When Column A Is Empty
    By grantfitz in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-19-2013, 04:34 PM
  2. [SOLVED] Excel VBA macro to select range separated by blank row and copy to next empty column
    By hackini in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-29-2013, 02:13 AM
  3. Replies: 5
    Last Post: 01-12-2013, 12:16 AM
  4. Replies: 4
    Last Post: 05-10-2012, 08:16 PM
  5. color blank cell red if blank or empty and count its occurances
    By stoey in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-01-2009, 08:21 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