View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
David David is offline
external usenet poster
 
Posts: 1,560
Default Macro to cut/paste to last cell

Hi,
The last row of the report, I think this will find that:
Sub Macro2()
Range("A1").Select
Selection.End(xlDown).Select
ReportLastRow = Activecell.Row
End Sub
This should put you on the last row.
What makes data unique in the subreport? Skip 4 rows from the bottom of the
"main" report? This would be (ReportLastRow +5).

Thanks,

"BethB" wrote:

Hello all, and many thanks for previous help. Once again, I am stumped. I
have a worksheet that contains a report and subreport I am exporting from
Acess into Excel. The data in the report and subreport are variable
(sometimes more, sometimes less). I export the file into Excel, and the
subreport portion comes up off to the side below the report portion on the
same worksheet (i.e. the report fills up A1:I151, and the sub report fills up
J52:M64).

I've got enough wherewithal to figure out how to find the last cell with
data in it, and to find the cell containing unique data in the subreport to
select the 5 or so columns contained in it, just not able to string this all
together.

The issue here is that since it's all variable, today the report section may
end at row 151, and tomorrow it may go to row 250 or only row 50.
Additionally, I need to find the last cell of the report section (i.e.
A1:I151) with data in it, not the last row with data in it on the whole
sheet.

I need to be able to A)Find the unique data in the subreport to select the
data I need to cut, B)find the last row of the report with data populated in
it, C) skip 4 rows and paste the information cut from the subreport section.
I'd leave this all in Access, but it's going to a customer who has to have it
in Excel.

Any help would be most appreciated.
--
Best Regards,

Beth

--
Best Regards,

Beth