VBA Cell Formatting

m0ws3r

New Member
Joined
Sep 2, 2014
Messages
10
Hi,

I am wondering if it possible to have VBA code to automatically format cells based on a formula finding the next available occupied cell.

Data at present

RouteLoading OrderDestinationDest Ref
2a
11b
2c
21d
4e
3f
2g
31h


<tbody>
</tbody>

So the formula in the first column is =IF(B2=1,COUNT($A$1:A1)+1,"")
What i now would like is to add some VBA code in to my current macro which does various other bits of work in the workbook to format the table, something like the below

looking down column A it selects the blanks up to and including the occupied cell, selects all occupied cells in them rows and creates thick box border to seperate the routes

Many thanks for any help

Mick
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.

Forum statistics

Threads
1,214,522
Messages
6,120,022
Members
448,939
Latest member
Leon Leenders

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