×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Attachmate & Excel question, short

Attachmate & Excel question, short

Attachmate & Excel question, short

(OP)
Excel 2010 can handle up to 64 nested IF statements in a single line. Can the same be said for Attachmate? As an example, can I have a macro look at a specific location and based off the corresponding text run a specific action. As an example, 22 letters of the alphabet, can the macro look at a specific location, determine the letter, then based off and IF Statement, do a specific action dependent on that letter? Yes or no would be good at this point, so I can attempt it on my own if possible. Thanks guys.

RE: Attachmate & Excel question, short

hi,

Excel formulas and VBA are two different animals.

If you were coding in Excel VBA, a Cadillac compared to the Attachmate Yugo, you could use the Select Case ... End Case statement structure.

But in Attachemate VB, just use If ... Else ... End If and nest them.

I'd strongly urge you to Block Indent your structures and this is how I'd start with a complete block

CODE

If x = x Then

    Else
    
    End If 
...and then start filling in the blanks: first the expression, then the statements to execute for TRUE, then FALSE. If there's no Else (FaLSE) then just delete those lines. Pre coding your block structures, For ... Next, Do ... Loop, With ... End With etc, keeps you from forgetting the struff that your compiler with bite you for.

Skip,

glassesJust traded in my OLD subtlety...
for a NUance!tongue

RE: Attachmate & Excel question, short

skip, why not use Select Case...End Select with attachmate? it seems so much easier

rem

RE: Attachmate & Excel question, short

I did not see select case in my extra basic help reference.

Skip,

glassesJust traded in my OLD subtlety...
for a NUance!tongue

RE: Attachmate & Excel question, short


I rarely code in Atachmate VB. Most of my codeing is in Excel VBA. And as it happened, my Extra VB Help did not reference the Select Case structure.

Select Case is probably the best approch for " 22 letters of the alphabet"

CODE

'all declarations at head of code module
    Dim s As String
'...... statements that follow declarations
   
    Select Case s
        Case "A"
            'this is what happens
            'when this value is
            'in the Case expression
        Case "B"
            'this is what happens
            'when this value is
            'in the Case expression
        Case Else
            'this is what happens
            'when this value is
            'none of the values
            'in the Case expression
    End Select 

Skip,

glassesJust traded in my OLD subtlety...
for a NUance!tongue

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close