none
VBA problem RRS feed

  • Question

  • Hi guys..this is it:

    LrowB = Worksheets("nota_interna_omn").Cells(Rows.Count, "B").End(xlUp).Row
    Dim clB As Range
        For Each clB In Worksheets("nota_interna_omn").Range("B16:B" & LrowB)
            If Not Intersect(Target, clB) Is Nothing And clB <> 0 Then
                Run "celulaB16"
            End If
        Next clB

    i need to change the equivalent cell of whatever cell i select in range (from b16 to lastrow in column B ) in the column I 

    Range("I" & ??).select

    PLS help me with this! I give my sincere thanks to whom solves this
    Friday, January 3, 2014 7:17 PM

All replies

  • The cell in column I in the same row as clB is

    clB.Offset(0, 7)

    since column I is 7 columns to the right of column B. Alternatively, you can use

    Range("I" & clB.Row)

    By the way, I'd try to avoid selecting cells in your code unless it is really necessary. For example, instead of the lines

    clB.Offset(0, 7).Select
    Selection.Value = 36

    you can use

    cb.Offset(0, 7).Value = 36


    Regards, Hans Vogelaar (http://www.eileenslounge.com)

    Friday, January 3, 2014 8:36 PM