return cell content using fixed terms to find range

tintin1012000

Board Regular
Joined
Apr 27, 2011
Messages
237
I have a complex one
In Sheet 1 I have a dynamic table of info which changes daily
I have 2 fixed terms '' FINISHED_GOOD and downtimeparetoTable which are always in Column A but can move rows, it depends on how many products I produce, sometimes it can be 3 product other days it might be 20

I want to use these terms to return the values between them and display in Sheet 2

so sheet 2 would show me the products build, I can use a Vlookup to get the Qty's from Column B

Example of Sheet 1
Column A
Column B
FINISHED_GOOD

<colgroup><col width="289"></colgroup><tbody>
</tbody>
Product 1
564
Product 2
123
Product 3
345
downtimeparetoTable

<tbody>
</tbody>
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
Try this!

Sub mid_rows()
Dim f_row As Long, l_row As Long, i As Long
f_row = Range("A:A").Find("FINISHED_GOOD").Row
l_row = Range("A:A").Find("downtimeparetoTable").Row
For i = f_row + 1 To l_row - 1
Sheets("Sheet4").Cells(i - f_row + 1, 1) = Cells(i, 1)
Next
End Sub
 
Upvote 0
Thanks, this worked
is it possible to adjust slightly to paste results starting in Cell A17 of sheet 4 ?

thanks a million



Try this!

Sub mid_rows()
Dim f_row As Long, l_row As Long, i As Long
f_row = Range("A:A").Find("FINISHED_GOOD").Row
l_row = Range("A:A").Find("downtimeparetoTable").Row
For i = f_row + 1 To l_row - 1
Sheets("Sheet4").Cells(i - f_row + 1, 1) = Cells(i, 1)
Next
End Sub
 
Upvote 0
This should do.

Sub mid_rows()
Dim f_row As Long, l_row As Long, i As Long
f_row = Range("A:A").Find("FINISHED_GOOD").Row
l_row = Range("A:A").Find("downtimeparetoTable").Row
For i = f_row + 1 To l_row - 1
Sheets("Sheet4").Cells(i - f_row + 16, 1) = Cells(i, 1)
Next
End Sub
 
Upvote 0
Thanks
that works perfect, lifesaver !

This should do.

Sub mid_rows()
Dim f_row As Long, l_row As Long, i As Long
f_row = Range("A:A").Find("FINISHED_GOOD").Row
l_row = Range("A:A").Find("downtimeparetoTable").Row
For i = f_row + 1 To l_row - 1
Sheets("Sheet4").Cells(i - f_row + 16, 1) = Cells(i, 1)
Next
End Sub
 
Upvote 0

Forum statistics

Threads
1,215,523
Messages
6,125,318
Members
449,218
Latest member
Excel Master

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