VBA - LOOP

shahzeb123

Board Regular
Joined
Jul 29, 2021
Messages
61
Office Version
  1. 2016
Platform
  1. Windows
Guys

Need your help; i need to extract below highlighted data into column L, now i have code which extract the data but it needs identificatio.

In this the identification is only below line of "identifier code", it may change sometime there is nothing mentioned in "F57A" then nothing to be extracted.

One identification is this field is always below to "BLOCK 4"

Please help !!!

1677739528583.png

Sub MyMacro()

Dim lr As Long
Dim r As Long

Application.ScreenUpdating = False

' Find last row in column A with data
lr = Cells(Rows.Count, "A").End(xlUp).Row

' Loop through all data
For r = 31 To lr
' Check to see if row above says "Block 4"
If Left(Cells(r - 1, "A"), 7) = "Block 4" Then
' Populate column L with formula
Cells(r, "L").FormulaR1C1 = _
"=MID(RC[-11],FIND(""ABOC"",MID(RC[-11],FIND(""F57A"",RC[-11]),999))+FIND(""F57A"",RC[-11])-1,11)"
End If
Next r

Application.ScreenUpdating = True

End Sub
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
Hi,
What exactly is going wrong with your code ... where there is no obvious coding mistake ...
 
Upvote 0
there is no coding mistake but it will identify "ABOC" then get me the data but here we need to specify first "F57A" then "identifier code" and whatever is mentioned below this till 11 digits only
 
Upvote 0

Forum statistics

Threads
1,223,954
Messages
6,175,603
Members
452,658
Latest member
GStorm

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