ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Looking for easy way to add data to the first empty row from a for (https://www.excelbanter.com/excel-programming/429550-looking-easy-way-add-data-first-empty-row.html)

Gluefoot

Looking for easy way to add data to the first empty row from a for
 
I'm pretty new to using forms in Excel. I'm wondering if there's a simple way
to write to the last empty row in a sheet without having to use a DO - LOOP
to find it.

Thanks for any suggestions!

Dave Peterson

Looking for easy way to add data to the first empty row from a for
 
I like to pick out a column that always has data in it if that row is used, then
I can use:

Dim NextRow as long
with worksheets("Somesheetnamehere")
nextrow = .cells(.rows.count,"A").end(xlup).row + 1
.cells(nextrow,"A").value = "something here"
end with

or

Dim NextCell as range
with worksheets("Somesheetnamehere")
set nextcell = .cells(.rows.count,"A").end(xlup).offset(0,1)
somerange.copy _
destination:=nextcell
end with



Gluefoot wrote:

I'm pretty new to using forms in Excel. I'm wondering if there's a simple way
to write to the last empty row in a sheet without having to use a DO - LOOP
to find it.

Thanks for any suggestions!


--

Dave Peterson


All times are GMT +1. The time now is 12:29 PM.

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