Home |
Search |
Today's Posts |
#1
|
|||
|
|||
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 |
#2
|
|||
|
|||
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro to copy value in empty cells | Excel Discussion (Misc queries) | |||
macro to look for empty cell | Excel Discussion (Misc queries) | |||
In Bar Chart, can we display both figures and their respective %a. | Excel Discussion (Misc queries) | |||
Date macro | Excel Discussion (Misc queries) | |||
Macro to hide rows with empty cells | Excel Worksheet Functions |