• Kalpesh Agrawal

VBA For loop- Data in cells

In the previous article, you learned how to show a message box of any constant or dynamic value…In this example, you will learn how to use for loop to enter the data in cells.

In this example, only one line of code will be changed.

“Cells (Row no, Column no.).Value = “___” “

Instead of

“Msgbox ___ “

Here, if you write (1, 1) after cells, the code will write “VBA Learning” only in the cell (1, 1).

I make it dynamic and put y in the place of “Column no.”, so it changes the value of y every time.

Related: VBA For loop- Message Box
Related: Excel VBA common basic questions
Related: How to Record, Run and Save Macro


Recent Posts

See All