maninjapan
07-18-2012, 10:40 AM
I am running a macro that copy and pastes data from a sheet ("Alert") that is updated daily, onto a separate sheet to keep record of the data. This was working fine until I needed to add a second type of data. I know have 2 types of data updated to the sheet daily and I need to paste them onto their respective sheets. However I am having a problem telling the macro where Level2 data stops and Level 1 data begins. Below is the following macro that I was using to date and I have attached a sample of the data in the hope that someone could look at it and give me an idea of how I might solve this.
Thanks in advance
Sub AlertPaste()
Dim LR1 As Long
LR1 = ThisWorkbook.Worksheets("Alert").Range("C" & Rows.Count).End(xlUp).Row
ThisWorkbook.Sheets("Alert").Range("A5").Copy
ThisWorkbook.Sheets("Level2").Range("D" & Rows.Count).End(xlUp).Offset(1, -3).PasteSpecial Paste:=xlPasteValues
ThisWorkbook.Sheets("Alert").Range("A7:Q" & LR1).Copy
ThisWorkbook.Sheets("Level2").Range("D" & Rows.Count).End(xlUp).Offset(1, -2).PasteSpecial Paste:=xlPasteValues
End Sub
Thanks in advance
Sub AlertPaste()
Dim LR1 As Long
LR1 = ThisWorkbook.Worksheets("Alert").Range("C" & Rows.Count).End(xlUp).Row
ThisWorkbook.Sheets("Alert").Range("A5").Copy
ThisWorkbook.Sheets("Level2").Range("D" & Rows.Count).End(xlUp).Offset(1, -3).PasteSpecial Paste:=xlPasteValues
ThisWorkbook.Sheets("Alert").Range("A7:Q" & LR1).Copy
ThisWorkbook.Sheets("Level2").Range("D" & Rows.Count).End(xlUp).Offset(1, -2).PasteSpecial Paste:=xlPasteValues
End Sub