Hi, I'm very new to VBA so apologies if this is a simple question. I was using a macro to capitalize all strings in two ranges. The current code I'm using looks like this:
This loops through every cell and capitalizes them individually, which doesn't seem very efficient. I am concerned about speed as I wanted to run this on many workbooks within a folder, so any gains in processing time are multiplied. Is there a way to write this macro so that it instead looks at the entire range at once and capitalizes everything in a single action? Would this actually make the macro run meaningfully faster?
VBA Code:
Dim x As Range
For Each x In SuppliesList.Range("B" & FilledRows + 1, "C" & SourceRows + FilledRows)
x.Value = UCase(x.Value)
Next
For Each x In SuppliesList.Range("J" & FilledRows + 1, "O" & SourceRows + FilledRows)
x.Value = UCase(x.Value)
Next
This loops through every cell and capitalizes them individually, which doesn't seem very efficient. I am concerned about speed as I wanted to run this on many workbooks within a folder, so any gains in processing time are multiplied. Is there a way to write this macro so that it instead looks at the entire range at once and capitalizes everything in a single action? Would this actually make the macro run meaningfully faster?