+ Reply to Thread
Results 1 to 3 of 3

Code to prevent user to Select COLUMNS but allow to select ROWS

  1. #1
    Registered User
    Join Date
    05-04-2011
    Location
    Philippines
    MS-Off Ver
    Excel 2007
    Posts
    1

    Code to prevent user to Select COLUMNS but allow to select ROWS

    I have a protected file that disables the user to insert and delete rows, instead I embedded a macro code to insert and delete columns with autofill of formulas for newly inserted rows.

    Below is the code:

    Please Login or Register  to view this content.
    The code unprotects the file first then insert the desired number of rows, then protects it again with the password. I did this to prevent my user to just insert rows without the autofill of formulas.

    The problem is when the user select an entire column, the code unprotects the sheet and insert new column and return a runtime error 1004 thus leaving the file unprotected again and the user can now see the formulas for the protected columns.

    Just want to ask if there is a possibility in a macro code to disable to select column headings but still allowing selection for row headings.

    Many Thanks!

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Code to prevent user to Select COLUMNS but allow to select ROWS

    You should be looking at Excel 2007's Table feature not VBA
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Code to prevent user to Select COLUMNS but allow to select ROWS

    Please Login or Register  to view this content.



+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1