none
help me in code RRS feed

  • Question

  • hello everyone ,

    my concept is first i have to enter text as Engine in (12,3) then from g13 to end column have to search for 0,* if it is found that particular column containing 0 or * should read the value present in the 3 and 4th row text value and it should be placed at (13,3) like wise it should go next row search for 0 and * this should go for last row . I HAVE explained the concept in example , i have written the code but can anybody write code for me please help me !!!! hope you will understand the logic .


    Dim searchRange As Range
    Dim C As Range
    Dim FinalRow As Range
    Dim firstaddress As String
    With Cells(12, 3)
    .Value = "Engine"
    .Font.Size = 14
    .Font.Bold = True
    End With
    Dim lastrow As Long
    lastrow = Cells(Rows.Count, 1).End(xlUp).Row
    Dim lastColumn As Integer
    lastColumn = ActiveSheet.Cells(2, Columns.Count).End(xlToLeft).Column


    For i = 13 To lastrow
    Set searchRange = Range("G13:ZZ20000")
    Set Rng = searchRange.Find(What:="0", LookIn:=xlValues, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False)
    firstaddress = Rng.Address
    Rng.Offset(i, -5).Value = Rng.Offset(-11, ActiveCell.Column).Value
    Next i

    for example 

    rows/columns A B C D E F G H I J K L M N O P Q R S T
    1
    2 ENGINE R R T R T R R T R T R R R R
    4 L L G H G H H G H G H H H H
    5
    6
    7
    8
    9
    10
    11
    12 ENGINE
    13 TG &RH - - 0 * - 0 * - 0 * 0 *
    14 RL & TG & RH 0 0 * 0 - - - 0 * 0 - -
    15 RL 0 0 -
    Saturday, June 4, 2016 4:37 PM