ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   adding data to a list (https://www.excelbanter.com/excel-programming/394853-adding-data-list.html)

Sandy

adding data to a list
 
I have 2 sheets. Sheet1 is for data entry. Sheet 2 (Say A4:Z4) collects all
the data. What I would like to do is copy Row 4 and insert it into the next
empty row starting at row 15. In other words if three records have already
been entered then the row for insertion would be Row 18. I visualise this
being done with a macro assigned to a "Save" button on Sheet1. Not sure how
to establish the next empty row. Any easy way to do this?
Sandy



Tom Ogilvy

adding data to a list
 
Assume column A will have an entry if the row is in use

Sub ABC()
If IsEmpty(Range("A15")) Then
Set rng = Range("A15")
ElseIf IsEmpty(Range("A16")) Then
Set rng = Range("A16")
Else
Set rng = Range("A15").End(xlDown)(2)
End If
MsgBox rng.Address
End Sub


Now rng should be a reference to the first cell in the next empty row
starting with A15

--
Regards,
Tom Ogilvy




"Sandy" wrote:

I have 2 sheets. Sheet1 is for data entry. Sheet 2 (Say A4:Z4) collects all
the data. What I would like to do is copy Row 4 and insert it into the next
empty row starting at row 15. In other words if three records have already
been entered then the row for insertion would be Row 18. I visualise this
being done with a macro assigned to a "Save" button on Sheet1. Not sure how
to establish the next empty row. Any easy way to do this?
Sandy




Sandy

adding data to a list
 
Once again many thanks
Sandy

"Tom Ogilvy" wrote in message
...
Assume column A will have an entry if the row is in use

Sub ABC()
If IsEmpty(Range("A15")) Then
Set rng = Range("A15")
ElseIf IsEmpty(Range("A16")) Then
Set rng = Range("A16")
Else
Set rng = Range("A15").End(xlDown)(2)
End If
MsgBox rng.Address
End Sub


Now rng should be a reference to the first cell in the next empty row
starting with A15

--
Regards,
Tom Ogilvy




"Sandy" wrote:

I have 2 sheets. Sheet1 is for data entry. Sheet 2 (Say A4:Z4) collects
all
the data. What I would like to do is copy Row 4 and insert it into the
next
empty row starting at row 15. In other words if three records have
already
been entered then the row for insertion would be Row 18. I visualise this
being done with a macro assigned to a "Save" button on Sheet1. Not sure
how
to establish the next empty row. Any easy way to do this?
Sandy







All times are GMT +1. The time now is 05:11 PM.

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