現在、以下のコードを使用して、列全体を小文字に変更しています。
これを行うためのより効率的な方法があるかどうか疑問に思っていました-ワークシートに約150K行あります。
完了するまでに時間がかかり、時々Out of Memory
エラーが発生します。
最初のサブ
Sub DeletingFl()
Dim ws1 As Worksheet
Dim rng1 As Range
Application.ScreenUpdating = False
Set ws1 = Sheets("Raw Sheet")
ws1.AutoFilterMode = False
Set rng1 = ws1.Range(ws1.[a1], ws1.Cells(Rows.Count, "A").End(xlUp))
rng1.AutoFilter 1, "Florida"
If rng1.SpecialCells(xlCellTypeVisible).Count > 1 Then
Set rng1 = rng1.Offset(1, 0).Resize(rng1.Rows.Count - 1)
rng1.EntireRow.Delete
End If
ws1.AutoFilterMode = False
Call DeletingEC
End Sub
Sub DeletingEC()
Dim ws1 As Worksheet
Dim rng1 As Range
Application.ScreenUpdating = False
Set ws1 = Sheets("Raw Sheet")
ws1.AutoFilterMode = False
Set rng1 = ws1.Range(ws1.[a1], ws1.Cells(Rows.Count, "A").End(xlUp))
rng1.AutoFilter 1, "East Coast"
If rng1.SpecialCells(xlCellTypeVisible).Count > 1 Then
Set rng1 = rng1.Offset(1, 0).Resize(rng1.Rows.Count - 1)
rng1.EntireRow.Delete
End If
ws1.AutoFilterMode = False
Worksheets("Raw Sheet").Activate
Call Concatenating
End Sub
セカンドサブ
Sub Concatenating()
Columns(1).EntireColumn.Insert
Columns(2).EntireColumn.Copy Destination:=ActiveSheet.Cells(1, 1)
Dim lngLastRow As Long
lngLastRow = Cells(Rows.Count, "A").End(xlUp).Row
Range("A2:A" & lngLastRow).Formula = "=F2 & ""_"" & G2"
Range("A1").Select
ActiveCell.FormulaR1C1 = "Title"
Call LowerCasing
End Sub
Sub Lowercasing()
Dim myArr, LR As Long, i As Long
LR = Range("A" & Rows.Count).End(xlUp).Row
myArr = Range("A1:A" & LR)
For i = 1 To UBound(myArr)
myArr(i, 1) = LCase(myArr(i, 1))
Next i
Range("A1:A" & LR).Value = myArr
Set ExcelSheet = Nothing
End Sub