Add formula next to every adjacent cell (except blanks)

2vbr

New Member
Joined
Sep 27, 2020
Messages
6
Platform
  1. Windows
I have a column of data that's ocassionally seperated by blank rows. I have to paste a formula next to all of them (except the blanks, obviously).

Doing this manually, I paste the formula into B2 and I double-click that little square box in the bottom corner to auto-fill all the way down.

When it stops at the blank row, I just scroll down and paste the formula again, auto-fill again, and repeat until the formula is next to all cells in the A1 column:

A5IxN2p.png


I've tried using Record Macro to automate this, unfortunately it can't record "autofill next to ALL cells in the column", only to the end of a specific point. ie. B1:B300

Is there a VBA macro that is basically does:

1. Select cell B1
2. Paste 3. Paste same Formula next to all cells in column B if there is adjacent data?
 

Some videos you may like

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
55,343
Office Version
  1. 365
Platform
  1. Windows
@2vbr
While we do allow Cross-Posting on this site, we do ask that you please mention you are doing so and provide links in each of the threads pointing to the other thread (see rule 13 here along with the explanation: Forum Rules). This way, other members can see what has already been done in regards to a question, and do not waste time working on a question that may already be answered elsewhere.
 

Watch MrExcel Video

Forum statistics

Threads
1,127,156
Messages
5,623,079
Members
415,951
Latest member
Shen1986

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
Top