Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT
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.
Join the community of 500,000 technology professionals and ask your questions.