Consulting

Results 1 to 2 of 2

Thread: macro don't work normally

  1. #1

    macro don't work normally

    hi

    this may sound silly, but i am 10 days new to programming. i have a written a code that picks contents of cells , under some conditions, and concatenate in another workbook.sheet.cell

    the process works fine, next day nothing is working dunno why, i made a break point and watch variables it works fine and give me the result i want.

    i am near to through my self out of the window...

    any suggestions

    for easy reference type in the inputbox : 9-1 or 1-5


    ------------------------------------------------------
    [VBA]Sub IRnumbers()

    Static result As String
    Dim rn As Long
    Dim code As String
    code = InputBox("Please enter the code number")
    If code <> "" Then
    Workbooks("transmittal log.xls").Worksheets(5).Activate


    For rn = 1 To 10000
    Select Case Range("q" & rn)
    Case "ML"
    Select Case Range("r" & rn)
    Case code
    Select Case Range("h" & rn)
    Case "A", "B": result = result & Range("c" & rn) & "Rev." & Range("f" & rn) & ", "

    End Select
    Case "": Exit For
    End Select

    End Select

    Next rn
    End If
    doit (result)
    End Sub
    -------------------------------------------------------------------------
    Sub doit(txt As String)

    Workbooks("Pay 13 Summary .xls").Worksheets(4).Activate
    Range("i19").ClearContents

    Range("i19") = txt
    Range("i19").WrapText = True

    End Sub[/VBA]

  2. #2

Posting Permissions

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