Moving data to the next empty cell

Closed
ffgibbs - Jul 8, 2009 at 12:57 PM
 Rob - Sep 17, 2009 at 04:20 PM
Hello,

I am realitively new to writing code in excel. I have a button that when i click it it moves data from one cell that has done a calc to another cell as a holding place. I don't want to lose that data but need to go to the next empty cell below the first holding spot when I have further data to hold. The command below works for the first part but overides the next calc data.

How can I make this go to then next empty cell?


Private Sub CommandButton2_Click()
Sheets("sheet2").Range("N15") = Sheets("sheet2").Range("c18")
End Sub

1 response

Select
ActiveCell.Offset(1, 0).Range("A1").

I have used this in an Excel spreadsheet to select the next lower cell in column A (after pasting data from one spreadsheet to another and transposing the data). It's been awhile since I created the macro, but seems there is a "relative reference" component. Hope this helps.
14
Thank you for the information on July 21 of this year. But, was wondering if it can work on a different worksheet.
My hospital uses a check request form created in Excel and now a department wants to create a spreadsheet with only 4 of the fields i.e. Date - Company - Invoice # - Amount .

These are part of the originial form field and we would like another worksheet with these as headers and of course populate the information no matter how many times those fields are changed. I can use =(sheet1!H10) and it will have the same information until I add a new check request with different Dates - Company - etc.

The new worksheet will have the field headings but needs to move down one row once the origianl form is saved or changed?
Thanks in advance - ROB
0