Hi,

Try this code


Sub Test()
Range("A2").Select
While ActiveCell.Value <> ""
    ' For ZIP
    If ActiveCell.Offset(0, 5).Value = "" Then
        ActiveCell.Offset(0, 5).Value = 99999
    End If
    ' For B
    If ActiveCell.Offset(0, 6).Value = "" Then
        ActiveCell.Offset(0, 6).Value = 0
    End If
    ' For C
    If ActiveCell.Offset(0, 7).Value = "" Then
        ActiveCell.Offset(0, 7).Value = 0
    End If
    ' For BI
    If ActiveCell.Offset(0, 8).Value = "" Then
        ActiveCell.Offset(0, 8).Value = 0
    End If
    ' For TIV
    If ActiveCell.Offset(0, 9).Value = "" Then
        ActiveCell.Offset(0, 9).Value = 0
    End If
    ' For CONST
    If ActiveCell.Offset(0, 10).Value = "" Then
        ActiveCell.Offset(0, 10).Value = 0
    End If
    ' For YEAR
    If ActiveCell.Offset(0, 11).Value = "" Then
        ActiveCell.Offset(0, 11).Value = 9999
    End If
    ' For FL
    If ActiveCell.Offset(0, 12).Value = "" Then
        ActiveCell.Offset(0, 12).Value = 0
    End If
    ' For OCC
    If ActiveCell.Offset(0, 13).Value = "" Then
        ActiveCell.Offset(0, 13).Value = 0
    End If
    ' For SQFT
    If ActiveCell.Offset(0, 14).Value = "" Then
        ActiveCell.Offset(0, 14).Value = 0
    End If
    ' For COUNTRY
    If ActiveCell.Offset(0, 17).Value = "" Then
        ActiveCell.Offset(0, 17).Value = "USA"
    End If
    ActiveCell.Offset(1, 0).Select
Wend
End Sub



Regards
Bala

On May 29, 4:35 pm, manish gupta <mkg.necess...@gmail.com> wrote:
> hi all,
>
> I need a help to fill the blank cell in attached excel sheet with certain
> criteria as below-
>
> Field Name Acction Taken ZIP If blank fill with 99999 B If blank fill with 0
> C If blank fill with 0 BI If blank fill with 0 TIV If blank fill with 0
> CONST If blank fill with 0 YR If blank fill with 9999 FL If blank fill with
> 0 OCC If blank fill with 0 SQFT If blank fill with 0 COUNTRY If blank fill
> with USA
>
> I can do it manually but due to more file .i want any shortcut or Micros .
>
> can anyone help me regarding this.
>
> thanks in advance.
>
>  Input Template Sample NEW_19_test.xls
> 79KViewDownload

--~--~---------~--~----~------------~-------~--~----~
-------------------------------------------------------------------------------------
Some important links for excel users:
1. Excel and VBA Tutorials(Video and Text), Free add-ins downloads at 
http://www.excelitems.com
2. Excel tutorials at http://www.excel-macros.blogspot.com
3. Learn VBA Macros at http://www.vbamacros.blogspot.com
4. Excel Tips and Tricks at http://exceldailytip.blogspot.com
 

To post to this group, send email to excel-macros@googlegroups.com
If you find any spam message in the group, please send an email to:
Ayush Jain  @ jainayus...@gmail.com or
Ashish Jain @ 26may.1...@gmail.com
-------------------------------------------------------------------------------------
-~----------~----~----~----~------~----~------~--~---

Reply via email to