In this chapter, we are going to learn how to change the selection with one or more areas to values using VBA in Microsoft Excel.
Let’s take an example and understand, how we write the VBA code to change the selection with one or more area(s) to values.
How to change the selection with one or more area(s)?
We have data in Excel and we want to update that data in the same sheet but on selection.
Follow below given steps:-
Sub Values_10() Dim smallrng As Range For Each smallrng In Selection.Areas smallrng.Value = Range("A1:A5").Value Next End Sub
Conclusion:- In this way, we can update the value on the selection.
These are the VBA coding to update the value from one cell to another cell, one row to another row, one column to another column, one table to another table etc.
We would love to hear from you, do let us know how we can improve, complement or innovate our work and make it better for you. Write us at email@example.com.
The applications/code on this site are distributed as is and without warranties or liability. In no event shall the owner of the copyrights, or the authors of the applications/code be liable for any loss of profit, any problems or any damage resulting from the use or evaluation of the applications/code.