Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
SLW SLW is offline
external usenet poster
 
Posts: 2
Default Conditional formulas

HELP! is this possible?.. I need a formula, so if a cell shows "Credit Card"
then a row appears with areas for the credit card details, but if the cell
doesn't show "Credit Card" then the row stays hidden. Not sure if this makes
sense, what I want is a row to appear where the user can input their credit
card number, name etc. but the row to stay hidden if the paying by an
alternative method..
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,646
Default Conditional formulas

You can do that with an event sub, something like this: if Credit Card cells
are in column A, selecting this cells it'll unhide the next row otherwise it
hides the next row.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Column = 1 Then 'column A
If Target.Value = "Credit Card" Then
Rows(Target.Row + 1).EntireRow.Hidden = False
Else
Rows(Target.Row + 1).EntireRow.Hidden = True
End If
End If
End Sub

Post if you need help to install it!

Regards,
Stefi

SLW ezt *rta:

HELP! is this possible?.. I need a formula, so if a cell shows "Credit Card"
then a row appears with areas for the credit card details, but if the cell
doesn't show "Credit Card" then the row stays hidden. Not sure if this makes
sense, what I want is a row to appear where the user can input their credit
card number, name etc. but the row to stay hidden if the paying by an
alternative method..

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
SLW SLW is offline
external usenet poster
 
Posts: 2
Default Conditional formulas

Thanks so much for the response, that sounds like exactly what I need but you
will have to excuse my ignorance..not sure what an "event sub" is and I'm
afraid the 2nd half of your email is foreign to me - Is there any chance you
can explain what I need to do in laymans terms :0)

Thanks in advance

"Stefi" wrote:

You can do that with an event sub, something like this: if Credit Card cells
are in column A, selecting this cells it'll unhide the next row otherwise it
hides the next row.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Column = 1 Then 'column A
If Target.Value = "Credit Card" Then
Rows(Target.Row + 1).EntireRow.Hidden = False
Else
Rows(Target.Row + 1).EntireRow.Hidden = True
End If
End If
End Sub

Post if you need help to install it!

Regards,
Stefi

SLW ezt *rta:

HELP! is this possible?.. I need a formula, so if a cell shows "Credit Card"
then a row appears with areas for the credit card details, but if the cell
doesn't show "Credit Card" then the row stays hidden. Not sure if this makes
sense, what I want is a row to appear where the user can input their credit
card number, name etc. but the row to stay hidden if the paying by an
alternative method..

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,646
Default Conditional formulas

Open VBE (Alt+F11)
right click on your worksheet name in the Project explorer window (press
Ctrl+R if not visible)
choose View code from the local menu
Paste code in the code window popping up.

Regards,
Stefi

SLW ezt *rta:

Thanks so much for the response, that sounds like exactly what I need but you
will have to excuse my ignorance..not sure what an "event sub" is and I'm
afraid the 2nd half of your email is foreign to me - Is there any chance you
can explain what I need to do in laymans terms :0)

Thanks in advance

"Stefi" wrote:

You can do that with an event sub, something like this: if Credit Card cells
are in column A, selecting this cells it'll unhide the next row otherwise it
hides the next row.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Column = 1 Then 'column A
If Target.Value = "Credit Card" Then
Rows(Target.Row + 1).EntireRow.Hidden = False
Else
Rows(Target.Row + 1).EntireRow.Hidden = True
End If
End If
End Sub

Post if you need help to install it!

Regards,
Stefi

SLW ezt *rta:

HELP! is this possible?.. I need a formula, so if a cell shows "Credit Card"
then a row appears with areas for the credit card details, but if the cell
doesn't show "Credit Card" then the row stays hidden. Not sure if this makes
sense, what I want is a row to appear where the user can input their credit
card number, name etc. but the row to stay hidden if the paying by an
alternative method..

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
Conditional Formulas Louise Excel Worksheet Functions 8 June 12th 08 10:51 PM
conditional formulas jpj1 Excel Worksheet Functions 2 February 7th 08 07:19 PM
Conditional formulas HARSH BAHAL Excel Discussion (Misc queries) 1 October 4th 07 09:11 AM
Conditional Formulas Maybe? jrose Excel Discussion (Misc queries) 3 April 25th 06 12:12 PM
Conditional formulas with sum and if jackie Excel Discussion (Misc queries) 4 October 4th 05 06:44 PM


All times are GMT +1. The time now is 03:06 AM.

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

About Us

"It's about Microsoft Excel"