PeopleSoft Adoption Made Smooth & Simple!
On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool. Claim Your Free WalkMe Account Now
Private Sub Workbook_Open() If ActiveSheet.Cells(1, 11) = "Custom Attribute 3" Then 'nothing to do as already done ActiveWorkbook.Save Else 'fill extra columns FillColumnKLM 'now save and close Application.DisplayAlerts = False ActiveWorkbook.SaveAs "Active-transform.xls" Application.DisplayAlerts = True End If Application.Quit End Sub Sub FillColumnKLM() Dim WS As Worksheet, I As Long, RwCnt As Long Set WS = ActiveSheet RwCnt = WS.Cells(Rows.Count, 1).End(xlUp).Row WS.Cells(1, 11) = "Custom Attribute 3" WS.Cells(1, 11).Font.Bold = True For I = 2 To RwCnt On Error Resume Next If InStr(1, LCase(WS.Cells(I, 1)), "Fruit") Then WS.Cells(I, 11) = "Apple" Else End If If InStr(1, LCase(WS.Cells(I, 1)), "Vegetable") Then WS.Cells(I, 11) = "Carrot" Else End If Next Columns.AutoFit
Add your voice to the tech community where 5M+ people just like you are talking about what matters.