Burrgogi
Active Member
- Joined
- Nov 3, 2005
- Messages
- 495
- Office Version
- 2010
- Platform
- Windows
VBA Code:
Sub Fanatical_Table()
'
Workbooks.Open Filename:= _
"D:\Games\Game Collection\Fanatical Bundle Tracker Workbook (started on Nov 6, 2020).xlsm"
Sheets.Add After:=Sheets(Sheets.Count), Type:= _
"D:\Games\Fanatical Bundle Template 2C.xltx"
ActiveSheet.Name = Format(Date, "mm_dd_yyyy")
Range("A2").Select
ActiveSheet.PasteSpecial Format:="Text", Link:=False, DisplayAsIcon:=False
' This deletes the last 2 unnecessary columns
Columns("J:K").Select
Selection.Delete Shift:=xlToLeft
' Cut the trading cards (TC) column and move it to the left of the Playmode col.
Columns("I:I").Select
Selection.Cut
Columns("G:G").Select
Selection.Insert Shift:=xlToRight
Range("E2:E" & Cells(Rows.Count, "C").End(xlUp).Row).Formula = "=MID(C2, 7, 2)"
End Sub
I've got a very simple VBA routine and I'm stumped on the last part. Column C contains a string like this:
Steam 100%
Steam 84%
Steam 95%
Steam 91%
As you see from my code, it looks at the 2 numbers after "Steam " and enters the number into col. E as a formula. Most of the time, my data has only 2 digits in that particular column, but there are some occasions when it contains 3 numbers. How can I modify my formula to account for those instances?
Also, I'd like col. E to display the value instead of the actual formula.