I have a project with three lists on the same sheet next to each other.
List 1, 2, 3.
Each list has it's own icon, when I press it, it activates this code.
Sub 1QueryHandler()
'Insert Row
Range("B5").EntireRow.Insert
'Copy and paste XLookup formula
Range("B4").Copy
Range("B5").PasteSpecial xlPasteFormulas
'Prevent from deleting formula
Application.CutCopyMode = False
'Copy static date from dynamic formula
Worksheets("Data").Range("I2").Copy Worksheets("Index").Range("F5")
Worksheets("Index").Range("F5").Value = Worksheets("Data").Range("I2").Value
Application.CutCopyMode = False
'Make active cell job card number entry
Range("A5").Activate
End Sub
Referencing the code up above, when clicked a new row populates (Row 5), a formula and date are brought down. I then input my reference number (B5) and the xlookup formula will populate. When that happens there are other columns that I don't want effected by the addition of a row so I need to shift them back up to their original place. For example when I click and the row is added my data is then moved and I need it grabbed at H6:M20000 and O6:T20000 and I'd need to shift those entire ranges up one to then be H5:M20000 and O6:T20000.
List 1, 2, 3.
Each list has it's own icon, when I press it, it activates this code.
Sub 1QueryHandler()
'Insert Row
Range("B5").EntireRow.Insert
'Copy and paste XLookup formula
Range("B4").Copy
Range("B5").PasteSpecial xlPasteFormulas
'Prevent from deleting formula
Application.CutCopyMode = False
'Copy static date from dynamic formula
Worksheets("Data").Range("I2").Copy Worksheets("Index").Range("F5")
Worksheets("Index").Range("F5").Value = Worksheets("Data").Range("I2").Value
Application.CutCopyMode = False
'Make active cell job card number entry
Range("A5").Activate
End Sub
Referencing the code up above, when clicked a new row populates (Row 5), a formula and date are brought down. I then input my reference number (B5) and the xlookup formula will populate. When that happens there are other columns that I don't want effected by the addition of a row so I need to shift them back up to their original place. For example when I click and the row is added my data is then moved and I need it grabbed at H6:M20000 and O6:T20000 and I'd need to shift those entire ranges up one to then be H5:M20000 and O6:T20000.