Forum Discussion

Keith_Massey's avatar
Keith_Massey
Copper Contributor
Apr 14, 2023
Solved

Copy the row until it reaches "Waiting for data"

I have two columns both using a Index Match formula:  =IF(N3>0,INDEX($F$1:$I$1570,MATCH(N3,$F$1:$F$1570,0),2),"Waiting for data...")   The information in the 1st column shown are codes scann...
  • OliverScheurich's avatar
    OliverScheurich
    Apr 14, 2023

    Keith_Massey 

    Sub copy()
    
    Dim i, j As Long
    
    i = Application.WorksheetFunction.Match("Waiting for data...", Range("O:O"), 0)
    
    Range(Cells(3, 15), Cells(i - 1, 16)).copy
    Sheets("Tabelle2").Activate
    Range("A1").Select
    Selection.PasteSpecial Paste:=xlPasteValues
    Application.CutCopyMode = False
    
    End Sub

    You can try these lines of code. In the attached file you can click the button in cell Q2 to run the macro.

Resources