Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default 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
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
Find value and move to end of data in same row then move values in Diddy Excel Programming 9 March 30th 09 11:24 AM
Find Value and Move Rows to another Sheet franciz Excel Programming 2 September 14th 08 08:11 PM
Move Data From Active Sheet to New WorkBook Len Excel Programming 2 July 5th 07 02:32 PM
Find and Open Workbook then copy and move sheet cwilson Excel Programming 0 February 2nd 05 07:29 PM
EXCEL: Find data in worksheet and create a new sheet in same workbook Peacce Dog Excel Programming 3 November 18th 04 08:05 PM


All times are GMT +1. The time now is 08:14 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"