![]() |
select a range base on Column A
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 |
select a range base on Column A
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 -- Regards Frank Kabel Frankfurt, Germany JUAN wrote: 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 |
select a range base on Column A
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 -----Original Message----- 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 -- Regards Frank Kabel Frankfurt, Germany JUAN wrote: 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 . |
select a range base on Column A
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 -----Original Message----- 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 -- Regards Frank Kabel Frankfurt, Germany JUAN wrote: 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 . |
All times are GMT +1. The time now is 09:11 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com