Jump to content
Macro Express Forums

If Variable Contains 6 Or 7 Digits Or Letters


koden

Recommended Posts

I have to copy a field that can be 6 or 7 digits/letters

The progam I copy from is a mainframe system.

 

Therefore I do it this way:

 

I go to the start of the field and copy the first 6 marks into T2.

(T2 will always contain 6 numbers or letters).

Then I go back to start of field and copy 7 digits into T3.

(T3 will sometimes contain 7 numbers/letters and other times 6 and a space).

 

later in my macro I have to paste T2 or T3 out in another program.

 

But how do I made the right IF statement??

 

There is one where I can compare value or variable.

But how do I tell the "IF" that if T3 contains 7 marks than paste T3 and if T3 contains 6 marks and a blank, then paste T2.

 

Explanation:

 

The mainframe system is stupid....

So I have to go to the start of the field and hold shift and press arrow right 6 or seven times. Then i make ctrl+c.

If the 7 mark is blank, and I then paste it out in my other program, the other program sees it as a mark.

So therefore I have made this T2 and T3 solution :-))

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...