Copy Variable Row and Columns

Irene94

New Member
Joined
Jun 21, 2017
Messages
21
Hi experts, currently I have a data in this format


[TABLE="width: 500"]
<tbody>[TR]
[TD]H.Freq[/TD]
[TD]H.Uncorrect[/TD]
[TD]H.Correction[/TD]
[TD]H.Corrected[/TD]
[TD]H.Limit[/TD]
[/TR]
[TR]
[TD]x[/TD]
[TD]x[/TD]
[TD]x[/TD]
[TD]x[/TD]
[TD]x[/TD]
[/TR]
[TR]
[TD]x[/TD]
[TD]x[/TD]
[TD]x[/TD]
[TD]x[/TD]
[TD]x[/TD]
[/TR]
[TR]
[TD]x[/TD]
[TD]x[/TD]
[TD]x[/TD]
[TD]x[/TD]
[TD]x[/TD]
[/TR]
[TR]
[TD]x[/TD]
[TD]x[/TD]
[TD]x[/TD]
[TD]x[/TD]
[TD]x[/TD]
[/TR]
[TR]
[TD]x[/TD]
[TD]x[/TD]
[TD]x[/TD]
[TD]x[/TD]
[TD]x[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]V.Freq[/TD]
[TD]V.Uncorrect[/TD]
[TD]V.Correction[/TD]
[TD]V.Corrected[/TD]
[TD]V.Limit[/TD]
[/TR]
[TR]
[TD]x[/TD]
[TD]x[/TD]
[TD]x[/TD]
[TD]x[/TD]
[TD]x[/TD]
[/TR]
[TR]
[TD]x[/TD]
[TD]x[/TD]
[TD]x[/TD]
[TD]x[/TD]
[TD]x[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Tested xx[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]30~1000, 1000~4000[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

This data start from Row 34, there are other information before it, the number of row for the data "x" is variable, different file will have different row of data

How could I copy the cells from "H.Freq" to the data before "Tested"? The row "Tested xx" and the row below it is unwanted, and I only need column A, D and E.

The code I get after searching through the net is either copy until first empty space is met or until the last used cells...

Code:
 Range("A34").CurrentRegion.Copy Sheets(Sheets.Count).Range("A1")
This code only copy the cell "H.Freq" and its data

Code:
variable = Cells(Rows.Count, 1).End(xlUp).Row
Rows("34:" & variable).Copy Destination:=Sheets(Sheets.Count).Range("A1")
This code copy until the last used cells



Any help and advise is appreciated!
Thanks!
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
Sorry I that I forgot to mention about the destination
I need the data copy and paste at the same worksheet from Range A1 and delete the other unwanted information.
 
Upvote 0
Sorry that I forgot to mention about the destination
The destination is at the same worksheet, other information should be deleted, which mean only the data that I have mentioned is left.
Again, thanks for any help and advise!
 
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