Find data below a blank cell in between 2 words

Status
Not open for further replies.

ceclay

Board Regular
Joined
Dec 4, 2019
Messages
58
Office Version
  1. 2016
Platform
  1. Windows
I have this table below wherein I would like to get the data below

Note that number of Participants differ from time to time. Would like to get the data in between Participants and Finishing Position,
Winner E/W 1/5 Top 6 and Finishing Position, Top 20 and Finishing Position, Top 10 and Finishing Position.


Test Golf.xlsx
A
1Participants
2Simpson, Webb
3Koepka, Brooks
4Casey, Paul
5Reed, Patrick
6Fleetwood, Tommy
7Rose, Justin
8English, Harris
9Griffin, Lanto
10Taylor, Vaughn
11Finishing Position
122221297128
13Opens
14
15200810 1457
16Winner E/W 1/5 Top 6
17Total
18WG
19Tot EW
20WG EW
21
221100
23-22,749
24-786
25-1,372
26-165
27
281200
2918,308
30911
311,375
3288
33
341700
3516,740
36911
371,221
3888
39
401700
4111,102
42652
43-248
4431
45
461900
4713,515
48911
49408
5088
51Finishing Position
522221297511
53Opens
54
55200810 1457
56Closes
57
58200813 1300
59Settles
60
61200816 2300
62NGL
63
642000
6577.3 %
66HIDE
67SUSPEND
68Leader after round 1 E/W 1/5 Top 6
69edit
70more_vert
71Top 10
72Total
73WG
74
75260
76-19,511
77-267
78
79263
80-1,497
81295
82
83300
84519
85295
86
87300
88852
89295
90
91350
92116
93166
94Finishing Position
952221297530
96Opens
97
98200810 1457
99Closes
100more_vert
101Top 20
102Total
103WG
104Tot EW
105WG EW
106
1072600
108-36,981
109198
110130
11129
112
1132900
114-25,372
115198
116-36
11729
118
1193400
120-6,937
121198
122-88
12329
124
1253400
126172
127198
128171
12929
130
1314100
132-31,270
133198
134-193
13529
136Finishing Position
1372221297508
138Opens
139
140200810 1457
141Closes
142
143200813 1300
144Settles
145Top 10
146Total
147WG
148Tot EW
149WG EW
150
151500
152-36,981
153198
154130
15529
156
157324
158-25,372
159198
160-36
16129
162
163567
164-6,937
165198
166-88
16729
168
1694577
170172
171198
172171
17329
174
175475
176-31,270
177198
178-193
17929
180Finishing Position
1812221297508
182Opens
183
184200810 1457
185Closes
186
187200813 1300
188Settles
Paste Here


Test Golf.xlsx
ABCDEF
1ParticipantsParticipantsWinner E/W 1/5 Top 6Leader after round 1 E/W 1/5 Top 6Top 20
2Thomas, WebbSimpson, Webb11002602600
3Alyssa, BrooksKoepka, Brooks12002632900
4Jaime, PaulCasey, Paul17003003400
5James, PatrickReed, Patrick17003003400
6Foldwood, TommyFleetwood, Tommy19003504100
7Winner E/W 1/5 Top 6
81100
91200
101700
111700
121900
13Leader after round 1 E/W 1/5 Top 6
14260
15263
16300
17300
18350
19Top 20
202600
212900
223400
233400
244100
25Top 5
26500
27324
28567
294577
30475
Result


VBA Code:
Sub Find_Data()
  Dim a As Range, b As Variant
  Dim sh1 As Worksheet, bStart As Boolean
  Dim lr As Long, j As Long, k As Long, m As Long
  
  Set sh1 = Sheets("Paste Here")
  lr = sh1.Range("A" & Rows.Count).End(3).Row
  ReDim b(1 To lr, 1 To 3)
  
  For Each a In sh1.Range("A1:A" & lr).SpecialCells(xlCellTypeConstants).Areas
    Select Case LCase(a.Cells(1))
      Case LCase("Winner E/W 1/5 Top 6"), LCase("Leader after round 1 E/W 1/5 Top 6")
        bStart = True
        j = 0
        If LCase(a.Cells(1)) = LCase("Winner E/W 1/5 Top 6") Then k = 2 Else k = 3
      Case LCase("Leader After Round 1")
        bStart = False
    End Select
    If bStart Then
      If LCase("Winner E/W 1/5 Top 6") <> LCase(a.Cells(1)) And LCase("Leader after round 1 E/W 1/5 Top 6") <> LCase(a.Cells(1)) Then
        m = m + 1
        b(m, 1) = a.Cells(1).Value
      End If
      j = j + 1
      b(j, k) = a.Cells(1).Value
    End If
  Next
  
  Sheets("Result").Range("A1").Resize(m, 3).Value = b
End Sub

Regards,
Cecille Layog
 
Last edited by a moderator:

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
Are you still using Office 2016 or do you have Office 365 or Office 2019?
 
Upvote 0
Status
Not open for further replies.

Forum statistics

Threads
1,214,788
Messages
6,121,603
Members
449,038
Latest member
Arbind kumar

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top