Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 270
Default 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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default 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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 270
Default 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





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Automatically extend a list when adding a new data to another list JB Excel Discussion (Misc queries) 0 March 25th 10 02:50 PM
Adding to a data validation list Josh Craig Excel Discussion (Misc queries) 2 June 30th 09 02:59 AM
Validation List -adding data and using it later POC Excel Discussion (Misc queries) 1 July 23rd 06 05:40 AM
Adding a blank in Data Validation List? Pheasant Plucker® Excel Discussion (Misc queries) 10 March 20th 06 03:06 PM
Adding rows to create list from DDE data Simon Excel Programming 2 December 7th 03 11:59 PM


All times are GMT +1. The time now is 04:47 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"