Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
diana
 
Posts: n/a
Default I need step by step instructions to create a macro for 10 imbedde.

I am trying to put 10 nested if statements in a cell. In Excel 2002, it now
only allows 7 embedded if statements. It says I need to make a macro. I need
step by step instructions. Can you help?
  #2   Report Post  
Nick Hodge
 
Posts: n/a
Default

Diana

There may be a different way to approach this if we knew what you are trying
to do, but in general you could write a UDF (User Defined Function) with a
Select...End select structure like so: (It takes in a whole number (iInput)
and returns a string corresponding to the entry 1-10)

You use it like any other worksheet function

=Get10Values(A1)

Function Get10Values(iInput As Integer) As String
Application.Volatile True
Select Case iInput
Case Is = 1
Get10Values = "One"
Case Is = 2
Get10Values = "Two"
Case Is = 3
Get10Values = "Three"
Case Is = 4
Get10Values = "Four"
Case Is = 5
Get10Values = "Five"
Case Is = 6
Get10Values = "Six"
Case Is = 7
Get10Values = "Seven"
Case Is = 8
Get10Values = "Eight"
Case Is = 9
Get10Values = "Nine"
Case Is = 10
Get10Values = "Ten"
Case Else
Get10Values = "Out of range"
End Select
End Function


--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
HIS

"diana" wrote in message
...
I am trying to put 10 nested if statements in a cell. In Excel 2002, it now
only allows 7 embedded if statements. It says I need to make a macro. I
need
step by step instructions. Can you help?



  #3   Report Post  
Ken Wright
 
Posts: n/a
Default

Give us details of what you are trying to do.

--
Regards
Ken....................... Microsoft MVP - Excel
Sys Spec - Win XP Pro / XL 97/00/02/03

----------------------------------------------------------------------------
It's easier to beg forgiveness than ask permission :-)
----------------------------------------------------------------------------

"diana" wrote in message
...
I am trying to put 10 nested if statements in a cell. In Excel 2002, it

now
only allows 7 embedded if statements. It says I need to make a macro. I

need
step by step instructions. Can you help?



  #4   Report Post  
Rob van Gelder
 
Posts: n/a
Default

Is it really necessary to go 7 layers deep?

Are there really 128 (2^7) outcomes or just 2 coutcomes?

You might be able to use the AND operator to reduce the layers of IF.

Let us know how you want to proceed?


--
Rob van Gelder - http://www.vangelder.co.nz/excel


"diana" wrote in message
...
I am trying to put 10 nested if statements in a cell. In Excel 2002, it now
only allows 7 embedded if statements. It says I need to make a macro. I
need
step by step instructions. Can you help?



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
How do I create a macro of editing keystrokes? scjanner Excel Discussion (Misc queries) 0 January 22nd 05 12:07 AM
How to create a macro that compares a list to another list Rampa New Users to Excel 1 January 13th 05 02:15 PM
how do I step thru a macro for troubleshooting ? chrisq Excel Discussion (Misc queries) 1 January 11th 05 08:27 PM
Is it possible to create a macro to group? Mike Piazza Excel Discussion (Misc queries) 1 January 8th 05 01:23 AM
How do I create a macro to Save As? Shelly9633 Excel Discussion (Misc queries) 3 December 3rd 04 06:38 PM


All times are GMT +1. The time now is 03:20 PM.

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"