Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Extra Help, pull String and put into excel.... 1

Status
Not open for further replies.

ptw78

Technical User
Mar 5, 2009
155
US
I'm wanting to pull a string of info from extra based on what I put into a macro. So for instance say I need to find a string that says "ABCDEFG12345 10/1/09". Is it possible to have the macro look for that string in the range of 10/20 thru 20/20 in extra?
 
I think I didn't elaborate enough on my original questions. What I'm wanting to do is find specific letters w/in the different note pages. So for instance I'd be looking to pull
[tt]LETTER1 REG MAIL - 8/04/08 [/tt]
and put it into excel, and do this for 10 diff letters and any number of accts. There would be an excel file where the accts numbers would be pulled from.
 


for 10 diff letters and any number of accts.
So you search for LETTER or something more specific?

And what about acct??? Where is that?

Please focus like a laser. Exactly what are the requirements?

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
ok, so I have an excel sheet with a list of accts, i can be any where from a couple hundred to a couple thousand. I want to pull the acct number from that excel list, search the notes which can be any number of pages long for specific letters and the date of the letter. An example of one letter is above. Now I'd have 10 more like that, not all accts will have all letters. I want to put that letter name and date onto an excel sheet w/the acct number.
 



So for each screen that you access, you need to loop thru your Excel list to search for a string.

When found, write to an Excel sheet.

that's your basic control structure.

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 

do i understand this correctly?
1. excel sheet has many acct entries
2. find one acct in extra
4. call up notes screen
5. look for particular letter(s) (10 different) in notes
6. notes can be multiple pages, PF8 to go forward
7. if found, then place letter and acct back into excel

what does your code look like so far?
can you give us 10 examples of the string (make them up)?
will the 10 strings always be the same?


 
how about something like this.

Code:
Sub Main
        Dim Sys As Object, Sess As Object, MyArea As Object
        Set Sys = CreateObject("EXTRA.System")
        Set Sess = Sys.ActiveSession
        Set Sess = Sess.Screen

        dim s(1 to 4) as String
        s(1) = "AAA"
        s(2) = "BBB"
        s(3) = "CCC"
        s(4) = "LETTER1"
        
'define For Excel data here
'find the first acct
    
        Do
    
        for x = 1 to 4
    
        Sess.MoveTo 1, 1
        
        mydat = s(x)
        
        Set MyArea = sess.Search(mydat,10)
        sess.MoveTo MyArea.Bottom, MyArea.Left
        MyRw = sess.Row
        MyCol = sess.Col
        if MyRw <> 1 or MyCol <> 1 then
        msgbox mydat
        
        FoundLtr = trim(sess.getstring (myRw, MyCol,60))
        msgbox FoundLtr
        'place FoundLtr into Excel here, then exit Do
        exit Do
        end if
    
        next x
        
        sess.sendkeys ("<pf8>")
    
        Loop 'Until No More Notes
        
        
'need next statement here to go to next acct 
        
    
End Sub
 
vzachin to answer your first post, you pretty much have it right on, i'm wanting to put the letter and date of the letter back into excel w/acct num. It can be a new excel file or the existing one where i get the acct nums from.
 
ptw78,

try what i gave you and see if it's close to what you're looking for...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top