Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 157
Default Copy from file1 sheet1/file2 sheet1 last blank row

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 180
Default Copy from file1 sheet1/file2 sheet1 last blank row

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 157
Default Copy from file1 sheet1/file2 sheet1 last blank row

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
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
=Sheet1!A1 - with a blank entry!!! CP Excel Discussion (Misc queries) 2 May 26th 09 11:00 PM
[=Sheet1!A1] - if i use Column A1 ('Sheet1') / A2 ('Sheet2') Lawrence C H Tan Excel Worksheet Functions 0 January 19th 07 08:29 PM
File comparing, fill file2 with value from file1 Mads Westen Excel Programming 3 November 10th 06 02:41 PM
Sheet1.Activate vs Sheet1.Select mikeburg[_46_] Excel Programming 4 October 11th 05 04:30 PM
Why Sheet1 is displayed in modules as sheet1 Jim at Eagle Excel Programming 2 April 22nd 05 03:09 PM


All times are GMT +1. The time now is 06:03 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"