Split File Name of Excel File to create sheet name

Change this solution to:

Assign str_variable = sampleData.Substring(0,4) + " " + sampleData.Substring(sampleData.Length - 9,4)

Changing the minus four, to minus 9 and adding ‘comma 4’.

I would recommend, that you train yourself in the basic string manipulations. For an example, you could have a look at this thread: How to manipulate a part of string: Split, Trim, Substring, Replace, Remove, Left, Right

1 Like