What Is Best Practice To Facilitate Column Layout Change In A Project?

ozex

New Member
Joined
Mar 27, 2024
Messages
7
Office Version
  1. 365
Platform
  1. Windows
This is a general 'best practice at project development stage' question re making any wsheet column layout changes easier.

Issue:
In development, if a worksheet layout change is required or upon project finalsation I have to backtrack on existing references to rows and columns which can easily lead to errors not all of which are immediately apparent if I miss one.
How can a worksheet layout change (as they apply to columns) be accommodated easier?
Can named ranges be applied to columns only and if so how would I do that?

Scope of current project:
Fixed 'display' columns, A to F and a number of hidden 'helper' columns G to R.
A dynamic number of data blocks each separated by an empty row.
Each block has a dynamic number of rows.
6,569 lines of code.
89 subs or functions.

Illustration:
(During project development column headers were different)
Col G = data block row index
Col H = production date
Col I = distrubutor name
Col J = color number of .Cells(x, "E"), (my preferred reference method) or .Range("E" & x)
Col K = data block sort index
Cols M to R = rowsource table constructed for a ListBox control

I am content with dynamic row control and change but column control and change can at times be frustrating to capture all that are needed.

If my explaination is sufficient, what is considered best practice to avoid possible code change errors?

Thank you.
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
I'd either use tables, or use named ranges. The named ranges only need to be a reference to one cell just to get a column number really.
 
Upvote 0
Solution
I'd either use tables, or use named ranges. The named ranges only need to be a reference to one cell just to get a column number really.
Thanks Rory, I suspected as such, in particular the tip about a one cell named range is useful. Before writing code I usually mock up some layouts but change is almost inevitable. As I'm sure you will be aware, sometimes design change is easy, other times less so despite find and replace,,,,,,, And for me it also depends on how long ago the project was first written.
 
Upvote 0

Forum statistics

Threads
1,224,811
Messages
6,181,081
Members
453,021
Latest member
Justyna P

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