The following macro is in a file that I inherited and I would like to change it so that it will stop after reaching the last row of data (blank after that). I am new to Macros and it looks like there is a lot of junk in this macro, but right now I just want to limit it to the data range which changes daily when this is run. Any help is appreciated.
Sub Subs_insert()
'
' Subs_insert Macro
'
'
Dim startLocation As Integer
startLocation = 2
endLocation = 225 * 13 + 225
rowLocation = 3
Do
Windows("Hotlist Template V2_1.xlsm").Activate
Range("B" & startLocation).Select
Selection.Copy
Windows("Hotlist V2_0 Tools.XLSX").Activate
Sheets("Family Tool").Select
Range("B2").Select
Range("B2").Activate
ActiveSheet.Paste
Range("C2:C14").Select
Application.CutCopyMode = False
Windows("Hotlist Template V2_1.xlsm").Activate
Windows("Hotlist V2_0 Tools.XLSX").Activate
Sheets("Family Tool").Select
Range("C9").Select
Windows("Hotlist Template V2_1.xlsm").Activate
Rows(rowLocation).Select
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
Range("B" & startLocation).Select
Selection.Copy
Windows("Hotlist V2_0 Tools.xlsx").Activate
Sheets("Family Tool").Select
Range("B2").Select
ActiveSheet.Paste
Range("C2:AF14").Select
Application.CutCopyMode = False
Selection.Copy
Windows("Hotlist Template V2_1.xlsm").Activate
Range("B" & startLocation).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
' Windows("Hotlist V2_0 Tools.xlsx").Activate
' Sheets("Family Tool").Select
' Range("D2:AF14").Select
' Application.CutCopyMode = False
' Selection.Copy
' Windows("Hotlist Template V2_1.xlsm").Activate
' Range("D" & startLocation).Select
' Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
' Windows("LCD_DSI.XLS").Activate
' Application.CutCopyMode = False
Windows("Hotlist Template V2_1.xlsm").Activate
startLocation = startLocation + 14
rowLocation = rowLocation + 14
Loop Until startLocation > endLocation
End Sub
Bookmarks