Posted 14 hours ago14 hr FPCH Staff I have attached the VBA code (had to use a docx format to attach it). The purpose of the code is to change several columns from upper case to a mix. The code does the job, but whenever I save the code in VBA editor, I get a calculating threads message and it takes several minutes to complete. I am also seeing it when the code finishes.It basically locks access to the spreadsheet and the code until it completes. Of note, it starts with Application.ScreenUpdating = False followed by Application.Calculation = xlCalculationManual. It then resets them on completion.The way it works is it creates a filtered list by hiding the rows of interest, applying the changes and then unhides everything at the end.I have 27 workbooks that need this done to them, at this rate, I will have retired!This a sample of the original data.
13 hours ago13 hr You can try this:VBA Code ExampleSub ChangeToMixedCase() Dim cell As Range Dim ws As Worksheet ' Set the worksheet you want to work with Set ws = ThisWorkbook.Sheets("Sheet1") ' Change "Sheet1" to your sheet name ' Loop through each cell in column A (adjust the range as needed) For Each cell In ws.Range("A1:A" & ws.Cells(ws.Rows.Count, "A").End(xlUp).Row) If Not IsEmpty(cell.Value) Then cell.Value = Application.WorksheetFunction.Proper(cell.Value) End If Next cell MsgBox "Column A has been changed to mixed case." End SubInstructions to Use the CodeOpen Excel and press ALT + F11 to open the VBA editor.In the VBA editor, go to Insert > Module to create a new module.Copy and paste the above code into the module window.Change "Sheet1" to the name of your worksheet if necessary.Press F5 to run the code or close the VBA editor and run it from Excel.What This Code DoesIt loops through each cell in column A.It checks if the cell is not empty.It converts the text in the cell to proper case (first letter of each word capitalized).A message box will pop up indicating that the process is complete.Let me know if this helps.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.