Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Help w/ Left, Right, Mid String
Hi all,
I have a vb script that reads a file and dumps the file name and totals into a spreadsheet - that part works! I need to parse the filename and also only read the last three numerics from the totals(strline) - instead of "Total # 45". <code snip objExcel.Activeworkbook.worksheets(1) _ .cells(rw,1).Resize(1,2).Value = Array(file.Name, strLine) objExcel.Activeworkbook.Worksheets(1).Columns(1).R esize (,2).Autofit ActiveCell.EntireRow.Cells(1, "C").Value = Left (file.name,3) ActiveCell.EntireRow.Cells(1, "D").Value = Mid(file.name, 5,6) ActiveCell.EntireRow.Cells(1,"E").value = Right (strLine,4) ************** I get an invalid procedure call "left" when running this code. File Name example -- ABC-091004.txt StrLine Example -- Total# 45 ( may have 4 numerics) The complete file name goes into A2, and the complete strLine goes into B2 and I would like the script to automatically parse the string and put "ABC" into C2, "091004" into D2, and " 45" into E2. Thanks in advance for your time and effort ;) |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
when inserting new worksheets they read right to left not left to. | Setting up and Configuration of Excel | |||
How to extract left-most number from a string | Excel Worksheet Functions | |||
My Excel view is Right to Left instead of Left to Right !!! | Excel Discussion (Misc queries) | |||
Remove left text string | Excel Discussion (Misc queries) | |||
How to change the right-to-left worksheet to left-to-right workshe | Excel Discussion (Misc queries) |