select a range base on Column A

J

JUAN

Hello,
I have a few reports appended in one excel sheet. I want
to be able to select the specific range of one report and
cut so that I can paste into either new sheet or workbook.
Example, Column A contains the report name and at end
contains the total
Line items (Report name)
Data
Total Line Items (end of report
So would like to select this portion.
Hope I'm making sense. Please advise any info.

Thanks,

Juan
 
F

Frank Kabel

Hi
try something like
sub foo()
dim lastrow as long
Dim firstrow as long
Dim rng as range

with activesheet
lastrow = .Cells(Rows.Count, 1).End(xlUp).Row -1
firstrow = 2
set rng = .range("A" & firstrow & ":A" & lastrow)
msgbox rng.address
end with
end sub
 
J

Juan

Hello Ken,
thanks, but this doesn't do what I want. This code
basically just tells me the last row. What I would like to
do is to select a range of data to copy to another place.
My workbook contains a few reports appended together so
need to take each report and move to different place.
Each report is separated by the last row which contains
the total. So example,
First report starts at Line Items (which is the report name
data
end of report Total Line items
Second report Line items per2
Data
End of repot Total Line items per 2
ETC, sO need to find a way to select between Report name
and end of its total row.
Hope I'm making sense. I really appreciate all your help.
I'm trying to modify the code but without success.
Please advise
thanks,
juan
 
J

Juan

Hello Frank
just to let you know, I was able to figure out what I
wanted. So thanks alot for the info you provided.

Juan
 
Top