View Single Post
 
Old 04-11-2024, 04:04 AM
Italophile Italophile is offline Windows 11 Office 2021
Expert
 
Join Date: Mar 2022
Posts: 538
Italophile is just really niceItalophile is just really niceItalophile is just really niceItalophile is just really nice
Default

Quote:
Originally Posted by Shelley Lou View Post
Hi, apologises but don't think I understand - does this line of code find only the very last cell in Column 2 - I only need to change the very last semi-colon not all of them?
Your code loops through the rows in the table. Unless there are vertically merged cells the last cell in a column will be in the last row of the table.

As you are using i as the row number the statement
Code:
 If i = .Rows.Count Then
indicates that you are in the last row and that rCell is, therefore, the last cell in column 2.
Reply With Quote