I need to copy and paste a range of data that is consistent but the starting cell changes. The format of the data is always the same, which is why I can always find the header "Total Units" but how do I then define teh range of data that I want to copy? I need to copy about 8 lines of data under the header, but I will not know the cell numbers.
Workbooks.Open Filename:= _<?xml:namespace prefix = o ns = "urn:schemas-microsoft-comfficeffice" /><o></o>
"C:\Macro\Calculator\Pending Activity 60 days\7 building.xls"<o></o>
Cells.Find(What:="total units", After:=ActiveCell, _<o></o>
LookIn:=xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, _<o></o>
SearchDirection:=xlNext, MatchCase:=False, SearchFormat:=True).Activate<o></o>
ActiveCell.Offset(7, 0).Select This is always the start of the range
Here is where I’d like to define a range of cells the column as the cell numbers may change and I only want to paste a selection of 8 cells.
Selection.Copy<o></o>
ActiveSheet.Paste<o></o>
Application.CutCopyMode = False<o></o>
Windows("occupancy data.xlsm").Activate<o></o>
Range("B4").Select<o></o>
ActiveSheet.Paste<o></o>
Application.CutCopyMode = False<o></o>
With Selection<o></o>
.WrapText = False<o></o>
.Orientation = 0<o></o>
.AddIndent = False<o></o>
.ShrinkToFit = False<o></o>
.ReadingOrder = xlContext<o></o>
.MergeCells = False
End With
<o></o>
Workbooks.Open Filename:= _<?xml:namespace prefix = o ns = "urn:schemas-microsoft-comfficeffice" /><o></o>
"C:\Macro\Calculator\Pending Activity 60 days\7 building.xls"<o></o>
Cells.Find(What:="total units", After:=ActiveCell, _<o></o>
LookIn:=xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, _<o></o>
SearchDirection:=xlNext, MatchCase:=False, SearchFormat:=True).Activate<o></o>
ActiveCell.Offset(7, 0).Select This is always the start of the range
Here is where I’d like to define a range of cells the column as the cell numbers may change and I only want to paste a selection of 8 cells.
Selection.Copy<o></o>
ActiveSheet.Paste<o></o>
Application.CutCopyMode = False<o></o>
Windows("occupancy data.xlsm").Activate<o></o>
Range("B4").Select<o></o>
ActiveSheet.Paste<o></o>
Application.CutCopyMode = False<o></o>
With Selection<o></o>
.WrapText = False<o></o>
.Orientation = 0<o></o>
.AddIndent = False<o></o>
.ShrinkToFit = False<o></o>
.ReadingOrder = xlContext<o></o>
.MergeCells = False
End With
<o></o>