PC Review


Reply
Thread Tools Rate Thread

accordian columns

 
 
Zewlsash
Guest
Posts: n/a
 
      29th May 2006

Hello,

I was working with someone's database at work. I was updating names.
I would add a new 'last name' into the first column, then when I hi
the right arrow a new column called 'first name' would suddenly open u
to the right of the last name column. After finishing a new row an
hitting [enter], the 'first name' column would disappear again. Ho
can I make columns do this? Thank you for any help.

E

--
Zewlsas
-----------------------------------------------------------------------
Zewlsash's Profile: http://www.excelforum.com/member.php...fo&userid=3489
View this thread: http://www.excelforum.com/showthread.php?threadid=54635

 
Reply With Quote
 
 
 
 
Bob Phillips
Guest
Posts: n/a
 
      29th May 2006
Here is one way

'-----------------------------------------------------------------
Private Sub Worksheet_Change(ByVal Target As Range)
'-----------------------------------------------------------------
Const WS_RANGE As String = "A:B"

On Error GoTo ws_exit:
Application.EnableEvents = False
With Target
If .Column = 1 Then
Columns(2).Hidden = False
Else
Columns(2).Hidden = True
End If
End With

ws_exit:
Application.EnableEvents = True
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.




--
HTH

Bob Phillips

(replace somewhere in email address with googlemail if mailing direct)

"Zewlsash" <(E-Mail Removed)> wrote in
message news:(E-Mail Removed)...
>
> Hello,
>
> I was working with someone's database at work. I was updating names.
> I would add a new 'last name' into the first column, then when I hit
> the right arrow a new column called 'first name' would suddenly open up
> to the right of the last name column. After finishing a new row and
> hitting [enter], the 'first name' column would disappear again. How
> can I make columns do this? Thank you for any help.
>
> Ed
>
>
> --
> Zewlsash
> ------------------------------------------------------------------------
> Zewlsash's Profile:

http://www.excelforum.com/member.php...o&userid=34894
> View this thread: http://www.excelforum.com/showthread...hreadid=546351
>



 
Reply With Quote
 
JE McGimpsey
Guest
Posts: n/a
 
      29th May 2006
One way, using an event macro:

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Columns(2).Hidden = Target.Column <> 1
End Sub


Put this in the worksheet code module (right-click the worksheet tab and
choose View Code).

In article <(E-Mail Removed)>,
Zewlsash <(E-Mail Removed)>
wrote:

> Hello,
>
> I was working with someone's database at work. I was updating names.
> I would add a new 'last name' into the first column, then when I hit
> the right arrow a new column called 'first name' would suddenly open up
> to the right of the last name column. After finishing a new row and
> hitting [enter], the 'first name' column would disappear again. How
> can I make columns do this? Thank you for any help.
>
> Ed

 
Reply With Quote
 
Zewlsash
Guest
Posts: n/a
 
      1st Jun 2006

Bob and JE,

Thank you both for the examples. They were helpful for me to see.

Ed


--
Zewlsash
------------------------------------------------------------------------
Zewlsash's Profile: http://www.excelforum.com/member.php...o&userid=34894
View this thread: http://www.excelforum.com/showthread...hreadid=546351

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Accordian and Data Objects Craig Lister Microsoft ASP .NET 0 15th Jul 2009 04:38 AM
Re: Accordian display when Moving a window? Malke Windows XP Hardware 1 25th Sep 2007 06:54 PM
Re: Accordian display when Moving a window? Bob I Windows XP Hardware 0 25th Sep 2007 06:50 PM
Parent Columns and Child Columns don't have type-matching columns microsoft news Microsoft ADO .NET 1 21st Sep 2004 10:08 AM
Xcel or Access sort columns of names so that I remove the intersect between 2 columns from one of the columns? William.R.Reisen Microsoft Access External Data 2 20th Dec 2003 02:23 AM


Features
 

Advertising
 

Newsgroups
 


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