'I am making a graph. First I would like to search the keyword "A-test" in column "B" and then select 10 rows and 2 columns from where I find the word. I am having difficultly to select the range. Please, help how to use "Set" function in this case. Here is the Macro I am testing
'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Sub Macro3()
Macro3 Macro
Dim Ws As Worksheet
Dim i As Long
Dim k As Long
Dim M As Range
EndRow = ActiveWorkbook.Sheets("Sheet1").Range("B1").Offset(Sheets("Sheet1").Rows.Count - 1, 0).End(xlUp).Row
i = 1
For k = 2 To EndRow
If Cells(k, 2) Like "*A*" Then
Set M = Range("C1:L1", ActiveCell(i, 2).Offset(2, 10)) 'Difficult
'Range("B1").Select 'test
'Range("C1:L1,B4:L5").Select 'test
End If
'Cells(k, 2) Like "*A*"
Next
End Sub
'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Here is the data.
Date choice Sample#1 Sample#2 Sample#3 Sample#4 Sample#5 Sample#6 Sample#7 Sample#8 Sample#9 Sample#10
2018/07/12 00:06:58 A-test 105259 103495 105225 103923 104536 103196 105020 104316 105317 103021
2018/07/12 00:07:03 B-test 105260 103848 105225 103923 104535 103196 105020 104316 105316 103021
2018/07/12 00:07:47 A-test 103108 101758 102702 101784 102592 101688 103971 103345 104344 101513
2018/07/12 00:07:51 B-test 103109 101410 102701 101785 102592 101688 103970 103346 104344 101513
2018/07/12 00:15:48 B-test 103108 101409 102702 101785 102593 101688 103971 103345 104345 101513
2018/07/12 00:40:16 B-test 103108 101408 102701 101785 102592 101688 103971 103345 104344 101513