If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Excel > appending data in workbook

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-07-09, 08:10
Maha_R Maha_R is offline
Registered User
 
Join Date: Apr 2009
Posts: 1
Question appending data in workbook

I need a macro for opening a file (User can select file), copy the data from the Sheet, append it to the exisiting open workbook (workbook with the macro)in the way, the data that is already present gets deleted.

am looking out for the solution for the past 2 days and eating my head ....
pls help me to solve this...thanks in advance
Reply With Quote
  #2 (permalink)  
Old 04-30-09, 03:36
burkular burkular is offline
Registered User
 
Join Date: Nov 2004
Location: Canada
Posts: 58
record a macro on the fly
open workbook where you want to append the data
open a workbook where you are getting you data to do the append
record macro
do a shift control home, then put your cursor in cell a1, then do a shift ctrl end then ctrl c to copy then select window and the other work book, then put your cursor into cell a1 then do a ctrl end, ctrl left arrow, then a ctrl p to paste
then flip back to your other workbook and close it.
Then stop recording. Look at the macro that was created.
then you can see the relevant syntax and then modify tweak to automate more fully, ie inputbox for filename, directory paths, etc, starting line, ending line, however you want to tweak.
This is a good way to learn how to do macros, record what you are trying to achieve and then review what the recorder has done and fill in the gaps.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On