Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
GCan someone please help me? I've looked at all the posts here regarding
doing this, but they don't seem to apply to what I want to do. I need to copy all data except column headings in row 1 from workbook1, Sheet1(consists of data in columns A-G and rows will vary by day) to workbook2, Sheet1 in the last blank row available. Both files have the same type of data, am just appending to workbook 1 daily. I've been doing this manually, but know there has to be an easier way. Is there a way to do this without opening workbook2? If not, that's fine, just thought I would see. Thank you so much for your help!!! |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Tasha,
Use the below macro. You can copy this in the source workbook from where you want the data to be copied- Dim myRange As Range Dim mLastRow As Integer Dim tLastRow As Integer 'find the last row in the current workbook mLastRow = Range("A65000").End(xlUp).Row 'set the range to copy Set myRange = Range("A2:G" & mLastRow) 'copy the data myRange.Copy 'Open the target workbook Workbooks.Open "C:\Test2.xls" 'Select the target worksheet Sheets("Sheet1").Select 'find the last row to copy tLastRow = Range("A65000").End(xlUp).Row + 1 'select the target cell Range("A" & tLastRow).Select 'Copy the data ActiveSheet.Paste 'close the target workbook with save changes ActiveWorkbook.Close yes This macro is tested and with inline comments to guide you. Hope this helps. -- Pranav Vaidya VBA Developer PN, MH-India If you think my answer is useful, please rate this post as an ANSWER!! "Tasha" wrote: GCan someone please help me? I've looked at all the posts here regarding doing this, but they don't seem to apply to what I want to do. I need to copy all data except column headings in row 1 from workbook1, Sheet1(consists of data in columns A-G and rows will vary by day) to workbook2, Sheet1 in the last blank row available. Both files have the same type of data, am just appending to workbook 1 daily. I've been doing this manually, but know there has to be an easier way. Is there a way to do this without opening workbook2? If not, that's fine, just thought I would see. Thank you so much for your help!!! |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Oh my Gosh, it works perfect!! I cannot thank you enough!!! And I really
really appreciate the play by play through the macro....I retain more when I know what it is I am actually doing!!! "Pranav Vaidya" wrote: Hi Tasha, Use the below macro. You can copy this in the source workbook from where you want the data to be copied- Dim myRange As Range Dim mLastRow As Integer Dim tLastRow As Integer 'find the last row in the current workbook mLastRow = Range("A65000").End(xlUp).Row 'set the range to copy Set myRange = Range("A2:G" & mLastRow) 'copy the data myRange.Copy 'Open the target workbook Workbooks.Open "C:\Test2.xls" 'Select the target worksheet Sheets("Sheet1").Select 'find the last row to copy tLastRow = Range("A65000").End(xlUp).Row + 1 'select the target cell Range("A" & tLastRow).Select 'Copy the data ActiveSheet.Paste 'close the target workbook with save changes ActiveWorkbook.Close yes This macro is tested and with inline comments to guide you. Hope this helps. -- Pranav Vaidya VBA Developer PN, MH-India If you think my answer is useful, please rate this post as an ANSWER!! "Tasha" wrote: GCan someone please help me? I've looked at all the posts here regarding doing this, but they don't seem to apply to what I want to do. I need to copy all data except column headings in row 1 from workbook1, Sheet1(consists of data in columns A-G and rows will vary by day) to workbook2, Sheet1 in the last blank row available. Both files have the same type of data, am just appending to workbook 1 daily. I've been doing this manually, but know there has to be an easier way. Is there a way to do this without opening workbook2? If not, that's fine, just thought I would see. Thank you so much for your help!!! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
=Sheet1!A1 - with a blank entry!!! | Excel Discussion (Misc queries) | |||
[=Sheet1!A1] - if i use Column A1 ('Sheet1') / A2 ('Sheet2') | Excel Worksheet Functions | |||
File comparing, fill file2 with value from file1 | Excel Programming | |||
Sheet1.Activate vs Sheet1.Select | Excel Programming | |||
Why Sheet1 is displayed in modules as sheet1 | Excel Programming |