I am trying to take data that was merged into one cell and retain the first 6 characters of that cell and move the remaining into the next column then proceed through the worksheet. I wrote the following macro and it runs successfully and then freezes excel to the point of a hard shut down. Any assistance would be greatly appreciated as I need to process thousands of rows of data
Sub SplitCell()
Dim ws As Worksheet
Dim cell As Range
Dim originalValue As String
Dim firstSixChars As String
Dim remainingChars As String
' Set the worksheet where your data is located
Set ws = Worksheets("Sheet1")
' Loop through each cell in the specified column (e.g., Column A)
For Each cell In ws.Range("A:A").Cells
originalValue = cell.Value
firstSixChars = Left(originalValue, 6)
remainingChars = Mid(originalValue, 7) ' Extract characters after the first 6
' Write the extracted values to adjacent columns
cell.Value = firstSixChars
cell.Offset(0, 1).Value = remainingChars
Next cell
End Sub