Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default Conditional Column Display

I am having trouble trying to figure this one out:

I am having customers fill out a form for me in excel, and am running into
issues with the data they are inputting. I think the best way to correct this
would be to restrict the fields that they can edit.
For instance: If a customer chose 'BI' from the drop down menu in column A,
I want him/her to be able to edit the neighboring cell in column B. Either by
having Column B hidden naturally, and only shown when 'BI' is selected, or
have it shown but can only be edited when 'BI' is selected.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 208
Default Conditional Column Display

I wrote the code below recently to do something similar... you could
tweak it to either lock or hide selected cells / columns based on the
user's input.

In summary, whenever the date in C12 is changed, the code determines
whether the change was in the 1st, 2nd or after the 2nd qtr and clears
and (un)locks the input cells accordingly.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$C$12" Then

If Range("c12").Value < DateSerial(2008, 4, 1) Then
ActiveSheet.Unprotect

' MsgBox "1st q"

Range("c17").ClearContents
Range("c17").Locked = True


Range("c23").ClearContents
Range("c23").Locked = True

ActiveSheet.Protect

ElseIf Range("c12").Value < DateSerial(2008, 7, 1) Then

' MsgBox "2nd q"
ActiveSheet.Unprotect
Range("c17").ClearContents
Range("c17").Locked = False

Range("c23").ClearContents
Range("c23").Locked = True

ActiveSheet.Protect

Else
' MsgBox "3rd or 4th q"
ActiveSheet.Unprotect
Range("c17").ClearContents
Range("c17").Locked = False

Range("c23").ClearContents
Range("c23").Locked = False

ActiveSheet.Protect

End If
End If


End Sub





On Jul 23, 8:41*am, Shawn Conn
wrote:
I am having trouble trying to figure this one out:

I am having customers fill out a form for me in excel, and am running into
issues with the data they are inputting. I think the best way to correct this
would be to restrict the fields that they can edit.
For instance: If a customer chose 'BI' from the drop down menu in column A,
I want him/her to be able to edit the neighboring cell in column B. Either by
having Column B hidden naturally, and only shown when 'BI' is selected, or
have it shown but can only be edited when 'BI' is selected.


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
display a conditional format in a range from another column DAN Excel Discussion (Misc queries) 10 March 9th 08 10:34 PM
Based on a condition in one column, search for a year in another column, and display data from another column in the same row look [email protected] Excel Discussion (Misc queries) 1 December 27th 06 05:47 PM
Display missing Part Number if Column A does not match column B Erik T Excel Worksheet Functions 2 April 17th 06 11:23 PM
Conditional Display Bampah Excel Worksheet Functions 2 December 5th 05 03:24 PM
Conditional Formatting that will display conditional data BrainFart Excel Worksheet Functions 1 September 13th 05 05:45 PM


All times are GMT +1. The time now is 08:12 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"