Restricting columns
Restricting columns
(OP)
Does anyone know a way of limiting the number of columns in excel ?
The reason is that I make up spreadsheets and use names like (for example) CTR3 for cells.
We have recently moved to excel 2010, and there are more columns available so these are now cell references and can't be used as names.
I can use CTR_3, but I prefer retaining the name CTR3 if possible.
I am never going to need enough columns to require column CTR - so can I set up excel so that (say) AA is the highest column letter.
The reason is that I make up spreadsheets and use names like (for example) CTR3 for cells.
We have recently moved to excel 2010, and there are more columns available so these are now cell references and can't be used as names.
I can use CTR_3, but I prefer retaining the name CTR3 if possible.
I am never going to need enough columns to require column CTR - so can I set up excel so that (say) AA is the highest column letter.





RE: Restricting columns
I'd recommend going with the _, which is better practice anyway.
Doug Jenkins
Interactive Design Services
http://newtonexcelbach.wordpress.com/
RE: Restricting columns
RE: Restricting columns
this code can rename named ranges, not sure if it will work though.
CODE
Sub named_region() MY_SOURCE = InputBox("Enter Source Sheet Name") Sheets(MY_SOURCE).Range("AA1").Select With Selection.ListNames For MY_ROWS = 1 To Range(("AA") & Rows.Count).End(xlUp).Row MY_RANGE_NAME = "lbl" & Range("AA" & MY_ROWS).Value MY_ADDRESS = Mid(Range("AB" & MY_ROWS).Value, 2, Len(MY_SOURCE)) MY_RANGE = Mid(Range("AB" & MY_ROWS).Value, Len(MY_SOURCE) + 3, Len(Range("AB" & MY_ROWS).Value)) If Left(MY_ADDRESS, Len(MY_SOURCE) + 3) = MY_SOURCE Then ActiveWorkbook.Names.Add Name:=MY_RANGE_NAME, RefersTo:="=" & MY_SOURCE & "!" & MY_RANGE ActiveWorkbook.Names(Range("AA" & MY_ROWS).Value).Delete End If Next MY_ROWS End With Sheets(MY_SOURCE).Columns("AA:AB").ClearContents End Subchange AA & AB to available columns.
----------------------------------
Hope this helps.
----------------------------------
been away for quite a while
but am now back
RE: Restricting columns
But then the huge new vistas became apparent and the inconveniences were forgotten.
I hope you discover and leverage the ones that can make your life easier. I found that Structured Tables have tremendous potential, for instance.
Now here I'm making an assumption. If you have headings in a PRIMARY SOURCE data table of CTR1, CTR2, CTR3 etc, and using Named Ranges to do analysis, then you're doing that in the wrong place. You ought not to be using a non-normalized table for analysis! You should have a normalized table that includes a column like...
But I could be mistaken.
Skip,
Just traded in my OLD subtlety...
for a NUance!