Excel - Exporting data to another spreadsheet

October 2016

Exporting data from one Excel spreadsheet to another spreadsheet is always a problem if you want to have the same flavor in the second too. Quite often, whenever a file from the Internet is being exported, it is being saved in a new file, not in the existing one. It takes so much time to reconfigure it. To solve this problem, one has to use data - import external data option under Excel with a new web query where the address of the web page has to be pasted. Then, using the import option, the proper destination can be sorted out.


  • I have a query. Whenever I export a file from the internet the data gets saved into a new Excel file instead of the Excel sheet I am working in. As a result I have to copy the data from that file to the Excel file I am working in. This is very time consuming. Is there a shorter method to directly export the data into the working Excel file?
  • I have another separate problem. I have recorded a macro for a particular worksheet. That macro does two things. 1. There are two cols. Column A and Column B. In col C it subtracts Col A from B. 2. It finds the weighted average between col A and C.

Now I want to run this macro in all worksheets except the first worksheet. What is the code to do that? </ital>


To solve this problem:
  • Copy the webpage address in Excel clipboard.
  • Go to your sheet.
  • Select any cell from where you want the file to be copied. e.g. A1.
  • Click data-import external data (or something like this depending upon the version) - new web query.
  • In the new web query window paste the address of the webpage at the top against "address".
  • Click on Go
  • You will get the whole webpage. Whatever table you want, click the tick mark and the whole table will be marked
  • Click "import" at the bottom right
  • It will ask where you want to park it. If it is already A1 click ok

To solve the second issue:
Sub test1()     
Dim j As Integer, k As Integer     
j = Worksheets.Count     
'MsgBox j     
For k = 1 To j     
'MsgBox Sheets(k).Name     
If Sheets(k).Name = "Sheet1" Then GoTo nnext     
Next k     
End Sub

Note that

Thanks to venkat1926 for this tip on the forum.

Related :

This document entitled « Excel - Exporting data to another spreadsheet » from CCM (ccm.net) is made available under the Creative Commons license. You can copy, modify copies of this page, under the conditions stipulated by the license, as this note appears clearly.