I have a excel spreadsheet with 2 sheets. In the first sheet, I got some values, when I click on a button then in the second sheet the following happens 1. a new row is inserted at the top 2. the data from the first sheet is copied.
However, there are some columns with formulas after the copied cells, and I dont know how to do in vbscript to copy those formulas after your insert a new row.
Sub Trade1()
Sheets("Trades").Select
Rows("2:2").Select
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
Range("A2:R2").Select
Selection.ClearContents
Range("A2").Select
Dim fromRange As Range, toRange As Range
Set fromRange = Sheets("Enter Trade").Range("B2:B20")
Set toRange = Sheets("Trades").Range("A2")
fromRange.Copy
toRange.PasteSpecial Paste:=xlPasteValues, Transpose:=True
End Sub