![]() |
Getting a macro to see the next available empty cell
One of my sheets has several identical forms with different data in the
cells. There is a button on each form linking that sheet to another. When I press that button it goes to the other sheet and autofill 3 cells from the previous sheet and form. What I need to do, as the new sheet has space for multiple entries, is when I click the button from another form it recognises that data already exists in the 3 cells and automatically fills the next 3 available unprotected cells. I have been at this for weeks and I am unable to find a solution in the help file. Much obliged to any assistance. Mark |
This tiny macro locates the "first" empty cell in a range and returns its row
number. If you call it with the range as a column, it will locate the first empty cell in the column-range. Once you have the row of the empty cell do Cells(i,j).Select where i comes from the function. Then you can do the election paste. Function FindIt(R As Range) As Long Dim l As Range FindIt = 0 For Each l In R If FindIt = 0 Then If l.Value = "" Then FindIt = l.Row End If End If Next End Function -- Gary''s Student "Mark 688" wrote: One of my sheets has several identical forms with different data in the cells. There is a button on each form linking that sheet to another. When I press that button it goes to the other sheet and autofill 3 cells from the previous sheet and form. What I need to do, as the new sheet has space for multiple entries, is when I click the button from another form it recognises that data already exists in the 3 cells and automatically fills the next 3 available unprotected cells. I have been at this for weeks and I am unable to find a solution in the help file. Much obliged to any assistance. Mark |
All times are GMT +1. The time now is 11:06 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com