![]() 'uncomment the next line to make the macro run to the end of the data in the column In the file attached to this workbook I included this piece of code: I left this code intentionally bare so that you can use it as a template and build upon it. In my example I put: Cells(cur_row, 1).Value = "something" which will put the text "something" into Column A every 2 rows (since 2 is the interval). Your code goes here! is the section where you put the code that you want to run every so many rows. Last_row is the last row that this should run on. Set this to whatever interval you want.įirst_row is the first row in the worksheet that the macro should run on. Interval is currently set to 2 and that means that the macro runs every two rows. You only need to change the interval, first_row, and last_row numbers. ![]() The macro in the workbook attached to this tutorial has a little more code and that is commented so you can understand it. ![]() If (cur_row - (first_row - 1)) Mod interval = 0 Then 'last row to go to - above version of this goes to the last row of the data in the prescribed column ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
February 2023
Categories |