ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Autofill until last cell in a row (https://www.excelbanter.com/excel-programming/402115-autofill-until-last-cell-row.html)

Little Penny[_2_]

Autofill until last cell in a row
 
In vba how do I:

Change the contents of cell E1 and F1 to the number o (zero) and the
autofill the contents the the last cell in each row.


Thanks


Dave Peterson

Autofill until last cell in a row
 
I used column A to find out the last used row.

Dim LastRow as long
with worksheets("Somesheetnamehere")
lastrow = .cells(.rows.count,"A").end(xlup).row

.range("e1:f" & lastrow).value = 0
end with

You can fill the whole range at once instead of using autofill.

Little Penny wrote:

In vba how do I:

Change the contents of cell E1 and F1 to the number o (zero) and the
autofill the contents the the last cell in each row.

Thanks


--

Dave Peterson


All times are GMT +1. The time now is 02:14 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com