Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Find last row in workbook sheet & move data to it from another sh
I have two worksheets within a workbook called Jobs Workbook
The worksheets are named Concrete & Database Concrete is the active worksheet I need to archive cell data from Concrete & piggyback it onto the next available row in Database (currently this worksheet has about 1100 rows of active data in 30 columns). Therefore from Concrete ( I would be using a button on it to assign the macro to) I would like the macro coding to first find the next available row after the last archived row(call it row n) in Database & using that address move the following data from Concrete to to the relevant cells in Row n of Database: Concrete(E1) to Database(An) Concrete(B3) to Database(Bn) Concrete(B1) to Database(Cn) Concrete(E5) to Database(Gn) Concrete(B55) to Database(Jn) Concrete(E2) to Database(Kn) When this is done I need to go back to the acttive worksheet (Concrete) and save the workbook. At a later stage I will be using the found row number n - so I need to know what to reference it by after this macro has found it Thanks Chris Then save the workbook Jobs Thank You |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Find last row in workbook sheet & move data to it from another sh
Please try the below and feedback. Variable lngLastRow will have the last row
Sub test() Dim lngLastRow As Long With ActiveWorkbook.Sheets("Database") lngLastRow = .Cells(Rows.Count, "A").End(xlUp).Row + 1 ..Range("A" & lngLastRow) = ActiveSheet.Range("E1") ..Range("B" & lngLastRow) = ActiveSheet.Range("B3") ..Range("C" & lngLastRow) = ActiveSheet.Range("B1") ..Range("G" & lngLastRow) = ActiveSheet.Range("E5") ..Range("J" & lngLastRow) = ActiveSheet.Range("B55") ..Range("K" & lngLastRow) = ActiveSheet.Range("E2") End With End Sub -- If this post helps click Yes --------------- Jacob Skaria "Chris Maddogz" wrote: I have two worksheets within a workbook called Jobs Workbook The worksheets are named Concrete & Database Concrete is the active worksheet I need to archive cell data from Concrete & piggyback it onto the next available row in Database (currently this worksheet has about 1100 rows of active data in 30 columns). Therefore from Concrete ( I would be using a button on it to assign the macro to) I would like the macro coding to first find the next available row after the last archived row(call it row n) in Database & using that address move the following data from Concrete to to the relevant cells in Row n of Database: Concrete(E1) to Database(An) Concrete(B3) to Database(Bn) Concrete(B1) to Database(Cn) Concrete(E5) to Database(Gn) Concrete(B55) to Database(Jn) Concrete(E2) to Database(Kn) When this is done I need to go back to the acttive worksheet (Concrete) and save the workbook. At a later stage I will be using the found row number n - so I need to know what to reference it by after this macro has found it Thanks Chris Then save the workbook Jobs Thank You |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Find value and move to end of data in same row then move values in | Excel Programming | |||
Find Value and Move Rows to another Sheet | Excel Programming | |||
Move Data From Active Sheet to New WorkBook | Excel Programming | |||
Find and Open Workbook then copy and move sheet | Excel Programming | |||
EXCEL: Find data in worksheet and create a new sheet in same workbook | Excel Programming |