Forum Discussion
Keith_Massey
Apr 14, 2023Copper Contributor
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...
- Apr 14, 2023
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 SubYou can try these lines of code. In the attached file you can click the button in cell Q2 to run the macro.
OliverScheurich
Apr 14, 2023Gold Contributor
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 SubYou can try these lines of code. In the attached file you can click the button in cell Q2 to run the macro.
Keith_Massey
Apr 14, 2023Copper Contributor
System is rebooting so I will have to test this out next week. Thanks I will give you the heads up.