Hi,
I am trying to get part of active worksheet name by avoiding date part after underscore. I used below code;
Given Sheet Name is Computers_July 15
Range("K2").Value = Left(ActiveSheet.Name, Len(ActiveSheet.Name) - InStr(ActiveSheet.Name, "_") )
And it returned below result - Compute
Where required result is - Computers
The sheet name is dynamic. If the sheet name is short it will take extra characters (for ex. APSS_Jul insted of APSS). If the sheet name is longer I get less characters like the example given above.
How can I correct it.
Thanks in Advance.
I am trying to get part of active worksheet name by avoiding date part after underscore. I used below code;
Given Sheet Name is Computers_July 15
Range("K2").Value = Left(ActiveSheet.Name, Len(ActiveSheet.Name) - InStr(ActiveSheet.Name, "_") )
And it returned below result - Compute
Where required result is - Computers
The sheet name is dynamic. If the sheet name is short it will take extra characters (for ex. APSS_Jul insted of APSS). If the sheet name is longer I get less characters like the example given above.
How can I correct it.
Thanks in Advance.