Quantcast
Channel: Excel Help Forum - Excel Programming / VBA / Macros
Viewing all articles
Browse latest Browse all 50222

Speed Up VBA Loop Code

$
0
0
I have the following code which runs through over 140K records and makes changes base on the code below. Currently, it is taking 20to 30 min to run this simple macro. Is there any way to speed up the code below to cut down the processing time?Thanks


Code:

Dim H As Range, I As Range, dd As Range
Set I = Range("E:E")
For Each dd In I.Cells
    If dd.Value = "1" Then dd = "A"
Next dd

For Each dd In I.Cells
  If dd.Value = "2" Then dd = "B"
Next dd

For Each dd In I.Cells
    If dd.Value = "3" Then dd = "C"
Next dd

For Each dd In I.Cells
    If dd.Value = "4" Then dd = "D"
Next dd

For Each dd In I.Cells
    If dd.Value = "5" Then dd = "E"
Next dd


Viewing all articles
Browse latest Browse all 50222

Trending Articles