After I tried this, the last names did not change. After some testing, I found that cell.Text was returning a null value. I can't figure out why the values for the last names are coming through as just text. When I try to convert the value using CStr, I get a type mismatch error. Since the cell...
I tried both suggestions and I still get a Type Mismatch error. I feel that the cell.Value is not coming through as a string value for some reason thus the Left command is not working.
Updated my script and I feel like I'm getting close. After running the script with PHV's snippet, I got a Type Mismatch error on the line: If cell.Value > " " Then
My first thought is that I'm comparing text and the > will not work. So I thought to use StrComp instead. The conditional seems to...
Thanks PVH for pointing me in the right direction. I will work on it today.
Skip, that was as far as I got. I didn't know how to code the last part. I was using REPLACE, LEFT & MID on the objRange instead of the cell values. Now I know I need attack the cell values and not just the selected column.
Here's my code, thanks for any assistance!
Set objExcel = CreateObject("Excel.Application")
objExcel.DisplayAlerts = False
strWB = "D:\content\Tournament."
Set objWorkbook = objExcel.Workbooks.Open(strWB & "xls")
objExcel.ActiveSheet.Rows("1:7").Delete...
I have a script that opens an Excel document and I would like to have it take the values of the last name column and replace them with just the first character. I have created a objRange for the column and tried using REPLACE, LEFT & MID with no luck. I will post my script when I get back to...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.