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
[TABLE="width: 500"]
<tbody>[TR]
[TD]Column A
[/TD]
[TD]Column B
[/TD]
[/TR]
[TR]
[TD]

<colgroup><col width="289"></colgroup><tbody>
[TD="width: 289"]FINISHED_GOOD
[/TD]

</tbody>
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Product 1
[/TD]
[TD]564
[/TD]
[/TR]
[TR]
[TD]Product 2
[/TD]
[TD]123
[/TD]
[/TR]
[TR]
[TD]Product 3
[/TD]
[TD]345
[/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[TD]downtimeparetoTable
[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
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,223,903
Messages
6,175,289
Members
452,631
Latest member
a_potato

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