For larger data manipulation you may want to go one step further and use a variant array rather than a range. It offers a performance gain over ranges if your code is taking a notably long time to run
1. Set up the range of interest (F2:F800)
2. Create a variant array (X) from the range
3. Loop through each record in the variant array and so something (in this example, make everything upper case)
4. Dump the array back over the initial range
Cheers
Dave
Code:
Sub ArrayWrite()
Dim rng1 As Range
Dim X
Dim lngRow As Long
Set rng1 = Range([f2], [f800])
X = rng1
For lngRow = 1 To UBound(X)
X(lngRow, 1) = UCase$(X(lngRow, 1))
Next
rng1 = X
End Sub
If you are interested in this technique then I have a more detailed article here that caters for multi-column ranges and single cell range areas at http://www.experts-exchange.com/A_2684.html
We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel
Which adblocker are you using?
Disable AdBlock
Follow these easy steps to disable AdBlock
1)Click on the icon in the browser’s toolbar. 2)Click on the icon in the browser’s toolbar. 2)Click on the "Pause on this site" option.
Go back
Disable AdBlock Plus
Follow these easy steps to disable AdBlock Plus
1)Click on the icon in the browser’s toolbar. 2)Click on the toggle to disable it for "mrexcel.com".
Go back
Disable uBlock Origin
Follow these easy steps to disable uBlock Origin
1)Click on the icon in the browser’s toolbar. 2)Click on the "Power" button. 3)Click on the "Refresh" button.
Go back
Disable uBlock
Follow these easy steps to disable uBlock
1)Click on the icon in the browser’s toolbar. 2)Click on the "Power" button. 3)Click on the "Refresh" button.