INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

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.

RE: Restricting columns

I'm pretty sure you can't do that. You can restrict the displayed range, but not the columns or rows that are allocated addresses.

I'd recommend going with the _, which is better practice anyway.

Doug Jenkins
Interactive Design Services
http://newtonexcelbach.wordpress.com/

RE: Restricting columns

You can also place the _ at the beginning of the label and have _CTR3 which is the obviously a label and not a cell.

RE: Restricting columns

Hello,

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 Sub 

change AA & AB to available columns.

----------------------------------
Hope this helps.
----------------------------------

been away for quite a while
but am now back

RE: Restricting columns

I sympathize with you! I can remember moaning and complaining when we moved from 2003 to 2007.

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...

Counter CntVal
CNT3        25
CNT6       312
CNT4        16
...
 
But I could be mistaken.

Skip,

glassesJust traded in my OLD subtlety...
for a NUance!tongue

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources


Close Box

Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close