Add formulas to specific columns

alialeola

New Member
Joined
Jul 6, 2022
Messages
21
Platform
  1. Windows
Hi guys,

Could you help me insert the below formulas into my VBA code?
These are all empty columns, with the header on row 2, so formulas should be added to row 3.

1705778870854.png
 
I would advise against the entire column.
But the last used row...I'm not near the computer atm.
So if no one helps out in the meantime, I'll repost tomorrow
 
Upvote 0

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
Thanks for the code. It is quite unclear just what you have on your sheet, where it is and what you are trying to achieve so what I am about to suggest may well not be quite what you want but hopefully might nudge you in the right direction.
But please test with a copy of your workbook.

Try adding these blue lines right near the end of the code where shown.

Rich (BB code):
    End With
    .Cells(3, LstCol - 6).Resize(LstRw - 2).Formula = "=1-H3/K3"
    .Cells(3, LstCol - 4).Resize(LstRw - 2).Formula = "=H3*1.2"
    .Cells(3, LstCol - 3).Resize(LstRw - 2).Formula = "=ROUND(K3*2,1)"
    .Cells(3, LstCol - 1).Resize(LstRw - 2).Formula = "=L3*M3"
End With
End Sub
 
Upvote 0
I would advise against the entire column.
But the last used row...I'm not near the computer atm.
So if no one helps out in the meantime, I'll repost tomorrow
Yes, thanks. By entire column, I actually meant the rows where there is data.
 
Upvote 0

Forum statistics

Threads
1,215,110
Messages
6,123,140
Members
449,098
Latest member
Doanvanhieu

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