Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


VBS Script Syntax Help

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,61433
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> VBS Script Syntax Help
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 VBS Script Syntax Help - 6/16/2008 10:19:28 AM   
  gi_james


Posts: 4
Score: 0
Joined: 6/14/2008
From: Misawa Japan
Status: offline
Please help on this.

I need to convert this to the correct syntax.

If column B ROWx = (a number greater than 999999) then

Cut the range(s) beneath it, and paste it at previous row starting at column H.
For example, here’s raw data (MINUS THE DASHES).
For every line that contains a confirmation number (i.e. 13483836), the line or lines beneath it needs to be moved over to  the end of the line with the confirmation number.  Like this:

Before:
2  -  13483836  -  SUPPORT  -  2  -  BLDG949  -  BLDG998  -  13:00
3  -  12:45  -  12:55  -  13:10   -  13:42  -  00:00  -  00:57  -  03B01912  -  SMITH, JOHN C


After:  (should be one line)
2  -  13483836  -  SUPPORT  -  2  -  BLDG949  -  BLDG998  -  13:00  -  3  -  12:45  -  12:55  -  13:10   -  13:42  -  00:00  -  00:57  -  03B01912  -  SMITH, JOHN C


(sometimes there are more than one line beneath) (Before)
2  -  13482116  -  SUPPORT  -  2  -  BLDG100  -  BLDG200  -  13:00
3  -  12:45  -  12:55  -  13:10   -  13:42  -  00:00  -  00:57  -  03B01915  -  DOE, JOHN C
3  -  12:55  -  12:55  -  13:50   -  13:52  -  00:00  -  00:55  -  03B01915  -  DOE, SARA C
3  -  12:45  -  12:55  -  13:10   -  13:42  -  00:00  -  00:57  -  03B01955  -  DOE, JANE C


(After)
2  -  13482116  -  SUPPORT  -  2  -  BLDG100  -  BLDG200  -  13:00  -  3  -  12:45  -  12:55  -  13:10   -  13:42  -  00:00  -  00:57  -  03B01915  -  DOE, JOHN C
                                                                                                             3  -  12:55  -  12:55  -  13:50   -  13:52  -  00:00  -  00:55  -  03B01915  -  DOE, SARA C
                                                                                                             3  -  12:45  -  12:55  -  13:10   -  13:42  -  00:00  -  00:57  -  03B01955  -  DOE, JANE C



I would greatly appreciate any help on this.  I can't seem to find what I need searching around on the net.  The alternative is manually cutting and pasting cells.  This take hours of time, time I'd rather be doing other things.



Thanks in advance,

_____________________________

James Strickland
Misawa Air Base, Japan
http://www.strickstuff.com
 
 
Post #: 1
 
 RE: VBS Script Syntax Help - 6/16/2008 1:39:59 PM   
  dm_4ever


Posts: 2666
Score: 46
Joined: 6/29/2006
From: Orange County, California
Status: offline
What code do you have so far?

_____________________________

dm_4ever

My philosophy: K.I.S.S - Keep It Simple Stupid
Read Me: http://www.visualbasicscript.com/m_24727/tm.htm
Frequently Asked Stuff: http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to gi_james)
 
 
Post #: 2
 
 RE: VBS Script Syntax Help - 6/16/2008 2:59:43 PM   
  gi_james


Posts: 4
Score: 0
Joined: 6/14/2008
From: Misawa Japan
Status: offline
This is the way I did it so far.  But this only works for that paticular file.


      

I did this by recording macro.  But, the problem is, that the number of rows varies. 

-James

_____________________________

James Strickland
Misawa Air Base, Japan
http://www.strickstuff.com

(in reply to dm_4ever)
 
 
Post #: 3
 
 RE: VBS Script Syntax Help - 6/17/2008 7:15:43 AM   
  mcds99


Posts: 434
Score: 4
Joined: 2/28/2006
Status: offline
Not sure if this is what you are looking for but his show how to read and write using excel.
Everything needs to be defined with excel each column needs to be identified.
The number of rows doesn't matter it reads from beginning to end of the spreadsheet.

From a previous post 8-O


      

_____________________________

Sam

Keep it Simple Make it Fun KiSMiF

(in reply to gi_james)
 
 
Post #: 4
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> VBS Script Syntax Help Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts