Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hi, I'm really stuck!!!! I've come across Ron de Bruin's website, which provides some great solutions for copying to other workbooks. Here's where I'm stuck. I would like to set my sourcerange to the last row that holds data and copy that row to another workbook on the next empty row of sheet1. I'm so close I can taste it !...I think ![]() I run the macro, I'm getting Here's what I've got so far. Sub CopytoSP_history() Dim sourceRange As Range Dim destrange As Range Dim destWB As Workbook Dim Lr As Long Dim Lr1 As Long Application.ScreenUpdating = False If bIsBookOpen("SPHistory.xls") Then Set destWB = Workbooks("SPHistory.xls") Else Set destWB = Workbooks.Open("C:\EVENT TRACKER\TrackerLog\METRO\SPhistory\SPHistory.xls") End If Lr = Sheets("sheet1").Range("B" & Rows.Count).End(xlUp).Offset(1, 0).Row Lr1 = Sheets("METRO").Range("B" & Rows.Count).End(xlUp).Offset(0, 0).Row Set sourceRange = ThisWorkbook.Worksheets("SP").Range("B" & Lr1) Set destrange = destWB.Worksheets("Sheet1").Range("B" & Lr) sourceRange.Copy destrange.PasteSpecial xlPasteValues, , False, False Application.CutCopyMode = False destWB.Close True Application.ScreenUpdating = True End Sub Thanks, Oreg -- Oreg ------------------------------------------------------------------------ Oreg's Profile: http://www.excelforum.com/member.php...fo&userid=9195 View this thread: http://www.excelforum.com/showthread...hreadid=480972 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
formula to copy data to empty cell | New Users to Excel | |||
How to copy data to the next empty cell in a column | Excel Worksheet Functions | |||
Copy Data From Filled to Empty Cells | Excel Discussion (Misc queries) | |||
Copy last row with data to next empty row... | Excel Programming | |||
macro to copy paste non empty data | Excel Programming |