I had the first code working fine, and amended it to the second. Now I get an "Insert method of Range class failed" message and the line "Selection insert..." is highlighted by the Debugger. Any solutions please? Basically every 5 seconds row 5 ranges are populated with fresh values. They get offset pasted to row 7 and previous pastes get shunted down by one row. The only other difference between the two versions is row 7 is now the next row after the header row of Tables. I did this so that formulas above become dynamic as the table expands.
Code
Sub Record_data()
Sheets("Data").Select
Sheets("Data").Rows("5:5").Select
Sheets("Data").Range("B5").Activate
Selection.Copy
Sheets("Data").Rows("7:7").Select
Sheets("Data").Range("B7").Activate
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("Data").Rows("7:7").Select
Sheets("Data").Range("B7").Activate
Application.CutCopyMode = False
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
End Sub
Display More
Code
Sub Record_tabledata()
Sheets("Data").Select
Dim Area
For Each Area In Range("C5:M5,S5:Y5,AE5:AK5,AQ5:AW5,BC5:BI5,BO5:BU5,CA5:CG5,CM5:CS5,CY5:DE5,DK5:DQ5,DW5:EC5,EI5:EO5,EU5:FA5,FG5:FM5,FS5:FY5,GE5:GK5,GQ5:GW5").Areas
Area.Offset(2, 0).Value = Area.Value
Next
Sheets("Data").Rows("7:7").Select
Sheets("Data").Range("B7").Activate
Application.CutCopyMode = False
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
End Sub
Display More