Results 1 to 2 of 2

Thread: DELETE PAST FORMULA IN EMPTY CELLS

  1. #1
    Junior Member
    Join Date
    Aug 2013
    Posts
    2
    Rep Power
    0

    DELETE PAST FORMULA IN EMPTY CELLS

    hi ,

    i have a userform to pull data in between multiple excel files. i need to set a target for each group.

    in this case , cat, dog, otter,rabbit

    but however when i search more than once in the userform, the previous formula on the blank cell appears. how do i go about??

    thanks

    Code:
    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

  2. #2
    Member
    Join Date
    Jun 2013
    Posts
    93
    Rep Power
    12
    attach please a sample file and explain better your goal

Similar Threads

  1. Replies: 5
    Last Post: 07-11-2013, 07:31 AM
  2. Delete Entire Row For All Empty Cells In Column
    By johnreid7477 in forum Excel Help
    Replies: 4
    Last Post: 06-15-2013, 05:50 AM
  3. Replies: 13
    Last Post: 06-10-2013, 09:05 AM
  4. Replies: 2
    Last Post: 09-24-2012, 11:19 PM
  5. Delete Empty Rows
    By Rasm in forum Excel Help
    Replies: 4
    Last Post: 04-28-2011, 02:13 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •