Add new row and copy the formula from the above cell

shaw600

New Member
Joined
Dec 2, 2016
Messages
9
Hi,

I have a macro that currently populates a table for me at the click of a button:

Dim LastRow As Long, ws As Worksheet
Set ws = Sheets("Job Database")
LastRow = ws.Range("A" & Rows.Count).End(xlUp).Row + 1 'Finds the last blank row
ws.Range("B" & LastRow).Value = Sheets("Add Job").Range("B1") '
ws.Range("A" & LastRow).Value = Sheets("Add Job").Range("B2") '
ws.Range("C" & LastRow).Value = Sheets("Add Job").Range("B3") '
ws.Range("D" & LastRow).Value = Sheets("Add Job").Range("B4") '
ws.Range("E" & LastRow).Value = Sheets("Add Job").Range("B9") '
ws.Range("F" & LastRow).Value = Sheets("Add Job").Range("B10") '
ws.Range("J" & LastRow).Value = Sheets("Add Job").Range("B5") '
ws.Range("K" & LastRow).Value = Sheets("Add Job").Range("B6") '
ws.Range("L" & LastRow).Value = Sheets("Add Job").Range("B7") '
ws.Range("M" & LastRow).Value = Sheets("Add Job").Range("B8") '
ws.Range("N" & LastRow).Value = Sheets("Add Job").Range("B11") '

In Columns G, H and I (on the Job Database) there are formulae, what can I add to the macro above so that the formulae automatically populate when the other information is added.

I have tried converting it into a table and dragging the formula down multiple rows (to try and trigger the AI), needless to say, I wasn't successful.

Regards,

Dan
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
try:

Code:
Sheets("Add Job").Range("B1").Copy ws.Range("G" & LastRow)

[code]
and the same for H & I
 
Upvote 0

Forum statistics

Threads
1,214,587
Messages
6,120,406
Members
448,958
Latest member
Hat4Life

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top