ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Help w/ Left, Right, Mid String (https://www.excelbanter.com/excel-programming/309937-help-w-left-right-mid-string.html)

DizzyD[_2_]

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 ;)


All times are GMT +1. The time now is 11:20 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com