+ Reply to Thread
Results 1 to 5 of 5

Typing text in a column undoing code that autohides other colums making them visible

  1. #1
    Forum Contributor Nitro2481's Avatar
    Join Date
    09-09-2014
    Location
    Laois, Ireland
    MS-Off Ver
    2013
    Posts
    323

    Typing text in a column undoing code that autohides other colums making them visible

    Hi Guys,

    I have attached a sample spreadsheet to illustrate my problem.

    I have the spreadsheet set up so when the first person logs in the numbers 1234 automatically populate into a cell in a few sheets. This is then a trigger for certain columns to unhide. If someone else logs in these numbers do not populate therefore keeping the columns hidden. Works perfect.
    However when logged in as user 1 & allcolumns are unhidden, I type anything in column "X" in sheet "Mort Figs" it undoes the 1234 and hides all the columns even though 1234 is still populated. This should not happen. I posted this a while back with no joy so hoping someone will be able to help.


    Any help really appreciated.

    Username: John
    Password: Test
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Typing text in a column undoing code that autohides other colums making them visible

    This line...
    Please Login or Register  to view this content.
    ...near the end of the Worksheet_Change event procedure for Mort figs is always run when there is a change to column X.

    I don't follow what you want to do, but if you don't want the columns hidden under certain conditions, wrap that line within some sort of IF-End If code block to test for 1234 in whatever cell you stuck it in.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Forum Contributor Nitro2481's Avatar
    Join Date
    09-09-2014
    Location
    Laois, Ireland
    MS-Off Ver
    2013
    Posts
    323

    Re: Typing text in a column undoing code that autohides other colums making them visible

    Hi alphafrog

    Thank you for your response. My level is still quite basic regarding VBA. All I've done so far has been wih the help of this forum. If a date is typed in column x I want the date brought over to sheet Banc *** & Home Ins. So thats why there is a trigger for column x. However I did not want it hiding columns. Columns should only hide if cell AJ1 is cleared. Any suggestions as to what I should wrap the code in would be great. If you need anymore info please let me know

    Thank you
    Nitro

  4. #4
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Typing text in a column undoing code that autohides other colums making them visible

    If Range("AJ1").Value = "" Then Range(sHide).EntireColumn.Hidden = True

  5. #5
    Forum Contributor Nitro2481's Avatar
    Join Date
    09-09-2014
    Location
    Laois, Ireland
    MS-Off Ver
    2013
    Posts
    323

    Re: Typing text in a column undoing code that autohides other colums making them visible

    Hi AlphaFrog

    I basically have this code at the end of every workbook so as the page protects everytime I save, close or open the workbook. (I'm sure there was an easier way of doing it)

    Please Login or Register  to view this content.
    I must have copied this code form earlier on in the Sheet code which included the bit in red. Once I delete this line the problem has stopped.
    Please Login or Register  to view this content.
    Thank you so much for your help and time.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Shorten IF/ElseIF statement when making Items visible/not visible
    By DHFE in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-11-2015, 11:29 AM
  2. Replies: 3
    Last Post: 07-08-2014, 11:08 AM
  3. [SOLVED] Need VBA Code for move to next visible column
    By Rajeshkumar R in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-01-2014, 02:44 AM
  4. VBA for filtering a column then filling down a text for visible cells in another column
    By rajkumarmp in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-18-2013, 04:00 PM
  5. [SOLVED] Word should not visible on Input box while typing!
    By Rajeshkumar R in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-17-2013, 09:06 AM
  6. Replies: 2
    Last Post: 02-13-2012, 03:03 PM
  7. [SOLVED] Is there a way of Making monthly tabs without typing each month?
    By UCAPERSinAlaska in forum Excel General
    Replies: 4
    Last Post: 12-07-2005, 02:20 PM

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