VBA, putting formula into empty cells.

awsumchillicrab

Board Regular
Joined
Jan 30, 2011
Messages
56
Hi, I'm really noob with VBA, and figure the best way to learn is with stuff that I really need in real life...

Because I can't seem to get good coherent VBA training tools online, and my library VBA books seem indefinitely booked.


I am looking for a way to scan through a column in my sheet, say Column B. If Column B meets some criteria (e.g. being empty), then I want a formula inputted into the cell. I would also want another formula inputted into the adjacent cells in Column C.

Any advice?
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
Maybe something like

Code:
Sub test()
On Error Resume Next
With Columns("B").SpecialCells(xlCellTypeBlanks)
    .Formula = "=A1"
    .Offset(, 1).Formula = "=B1"
End With
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,521
Messages
6,179,291
Members
452,902
Latest member
Knuddeluff

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