Simple VBA IF THEN to fill a cell with a value

NYEXCEL1

Board Regular
Joined
Apr 17, 2013
Messages
123
I dont have much experience with VBA but know this would be the best way to populate a long document.

If I have a value in column B beginning with cell B2 put the value "2019" in cell J2

Thats it!!



Additionally, i currently use a formula to remove all the data in a cell after a particular character ("!"), using the FIND and LEFT functions, can you add the same formula to VBA and replace the cell with the updated value?

thanks all
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
Yes you can using Evaluate, or you can just use VBA to insert the formula itself into the cells.
 
Upvote 0

Forum statistics

Threads
1,215,884
Messages
6,127,568
Members
449,385
Latest member
KMGLarson

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