Is there a way to extract numeric values from a string? I cant use "Val" as it only gets the value from left to right. example: "Sheet 15" I just need the 15, and the numbers are always on the right. I'm running into problems when it goes to double digits. Otherwise I would just use the "right(str), 1" method(if i use ,2... it causes problems downstream by adding an extra space). The first portion of code renames all the sheets in the format of Sheet 1, Sheet 2, etc and works fine. But like I said earlier, the trouble is when I have double digits in the sheet count.
Also, I don't necessarily need to extract this from the sheet name. If there's another way to get the current sheet number, fine by me.
Also, I don't necessarily need to extract this from the sheet name. If there's another way to get the current sheet number, fine by me.
Code:
Dim TitleBlockTexts As DrawingTexts
Set TitleBlockTexts = DrawingDoc1.sheets.ActiveSheet.views.Item("Background View").Texts
Dim SheetNum
Set SheetNum = TitleBlockTexts.GetItem("TitleBlock_Text_Sheet")
Dim SheetOfText
SheetOfText = "OF"
SheetNum.Text = UCase([COLOR=#EF2929]'Need this portion'[/color] & " " & SheetOfText & " " & Title_Block.Total_Sheet_TB.Value)