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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  • Users: PStrongs
  • Order by date
  1. PStrongs

    Any suggestions for more efficient time conversion code?

    Hi, I have written this procedure that converts decimal time (1.75) into analogue time (1hr 45 mins). It works ok, but seems a little verbose. Any suggestions for making it more efficient and shorter? Regards, Sub testString() Dim Duration As String Dim hrs As String, mins As String, totTime...
  2. PStrongs

    Split table into multiple tables

    Hi Gerry, Thanks for coming back. Understand about using ranges now, but not sure if it would help regarding part of the search requirement (the two column data). See the attached spreadsheet and this may give you a better idea of what I was after in the first place. As I said though, thanks to...
  3. PStrongs

    Split table into multiple tables

    Fumei you are a star! The code works exactly as i want it to. I have tried it on a document with over 4000 rows and it took around 20 minutes. Slow admittedly, but does the job. My perception is that the multiple tables are much easier to reference and quicker to search. I can now use this...
  4. PStrongs

    Split table into multiple tables

    Guys, Thanks for the input. Bong, I have tried your code and with my limited expertise have put together the code below. Text is found a range is set(not sure how accurate it is) and text is returned. Unfortunately, it only returns the first complete header row of the table and not the two...
  5. PStrongs

    Split table into multiple tables

    Hi Geoff, Try this link and see if it works.http://homepage.mac.com/pstrongs/FileSharing1.html
  6. PStrongs

    Split table into multiple tables

    Hi Guys, Tried your code Bong and it returns the Blank row indexes, so tried the code below: If Selection.Find.Found = True Then Selection.Select Selection.MoveLeft wdCell, 1, wdMove Selection.Select...
  7. PStrongs

    Split table into multiple tables

    Hi Geoff, Comforting to know that you are still there. Excel plays a part in this process as it stands now. The BO report is opened in Excel and the user manually selects the cells to be input into the word document. Through the process of formatting the document, the users selection is pasted...
  8. PStrongs

    Split table into multiple tables

    Hi Bong, i have just tried the code on a large document with little success. I hasten to add that this isn't due to your code, just the sheer size of the document. The document is some 450 pages long with over 2000 rows which could potentially result in 100+ individual tables. Unfortunately...
  9. PStrongs

    Split table into multiple tables

    Bong, Many many thanks! Makes sense now and everything works beautifully. Regards,
  10. PStrongs

    Split table into multiple tables

    Hi Bong, Thanks for the prompt reply. Changed the code to that shown below. There is a different error now: RunTime Error 4120 Bad parameter The offending line is newTable.Split (i) Sorry to be a pain, but i am new to VBA and still learning. Dim eRow as Row Dim newTable as Table Dim i as...
  11. PStrongs

    Split table into multiple tables

    Hi Bong, Thanks for correcting the code. Works great. The code splits the table into multiple tables. The only thing is that an error is generated at the end of the procedure: RunTime Error 5 Invalid procedure call or argument Dim eRow as Row Dim newTable as Table Dim i as Long Set newTable...
  12. PStrongs

    Split table into multiple tables

    Hi Bong, Hope you had a great weekend. Been tinkering with your code on a document and it seems to go into an infinite loop. I have used my own variables as follows: Dim eRow as Row Dim newTable as Table Dim i as Long Set newTable = ActiveDocument.Tables(1) i = 1 Do While i > 0...
  13. PStrongs

    Split table into multiple tables

    Hi Geoff, Excel may be the better option from a speed point of view, but the document that I am working in is a Word document. So I am finding text in a data range, if the search meets the criteria, the found text is assigned to a table in the main document. With a word table, I can search for...
  14. PStrongs

    Split table into multiple tables

    Hi Everyone, I have a .txt file that has been exported from Business Objects. I am formatting the file as a word document and then converting the text to a table. The resulting table can be in excess of 2000 rows. Each range of data within the table is separated by a blank row. I want to split...
  15. PStrongs

    Open a new document from within the closing document

    Hi Everyone, I revisited this problem with opening a document from the closing document and have found a solution. Quite simple really: Set the opening document UserForm to Modaless. Focus is maintained in the Closing document and passes to the opening document when the routine in the closing...
  16. PStrongs

    find text in table and assign the found text to another table

    I can only concur with WalkerEvans, because i too have been up said defacation inlet without means of propulsion as well. It has only been through the dedication of Fumei, yourself WalkerEvans and others that have helped me out. It is also a learning curve for me and hopefully, when I feel...
  17. PStrongs

    find text in table and assign the found text to another table

    Thanks WalkerEvans, Perhaps when I gain more experience, I too will be able to offer help to others. Regards and keep well,
  18. PStrongs

    find text in table and assign the found text to another table

    Hi WalkerEvans, Tried the code on the actual document and all is ok! Thanks once again for your help.
  19. PStrongs

    find text in table and assign the found text to another table

    Know the problem! Just one thing I noticed last night... When removing the end of cell marker etc: PS1=Left(PS1, Len(PS1)-2) PS2=Left(PS2, Len(PS2)-2) PS1 does just that, removes the end of cell marker and paragraph mark. However, PS2 removes the last two characters of the found text. I...
  20. PStrongs

    find text in table and assign the found text to another table

    Hi WalkerEvans, Just had 5 minutes to tinker with your code. Couldn't try it on the document that the code will be working on because i am not back in the office until Thursday, but it works great! Some Microsoft related sites recommend creating tables from text rather than assigning text...

Part and Inventory Search

Back
Top