Solved

Excel Macro

Posted on 2014-01-08
8
384 Views
Last Modified: 2014-01-13
Hi,

I am doing a task manually . Copying contents from web and paste it in a excel file on the corresponding heading.

I need your help on automating it.

The desired input and output sheet is attached.

The data need to populated based on headings to corresponding cells.

Thanks,
Magento
0
Comment
Question by:magento
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
8 Comments
 
LVL 27

Expert Comment

by:MacroShadow
ID: 39766538
Nothing attached.
0
 
LVL 5

Author Comment

by:magento
ID: 39766550
I am sorry .

Please find the attached.
sample-2.xlsx
0
 
LVL 27

Expert Comment

by:MacroShadow
ID: 39766612
Not really enough information to do anything with.

Do you want to automate the data download too? If so, what's the link?
Where's the source/destination? in the same file? separate files?
Anyway you can check out http://office.microsoft.com/en-us/excel-help/rotate-data-by-converting-columns-to-rows-or-vice-versa-HP005203138.aspx to convert columns to rows.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 13

Expert Comment

by:Alexander Eßer [Alex140181]
ID: 39766629
Moreover, you should check Excel's built-in pivot stuff, as shwon here: http://chandoo.org/wp/2009/08/19/excel-pivot-tables-tutorial/

or try to google ;-) (pivoting excel)
0
 
LVL 5

Author Comment

by:magento
ID: 39767090
Hi Macroshadow,

The first sheet is the input and the second sheet is the output.

I paste the content in sheet1 and run the macro , need the output in sheet 2.

Thanks
0
 
LVL 27

Accepted Solution

by:
MacroShadow earned 500 total points
ID: 39767290
This is the gist of it:
Sub Demo()

    Dim rngSource As Range
    Dim rngDestination As Range
    
    Set rngSource = Sheets("Given").Range("A1:B71")
    Set rngDestination = Sheets("Required").Range("A1:B71")
    
    rngSource.Copy
    rngDestination.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:=False, Transpose:=True
    
End Sub

Open in new window


For lack of details I couldn't give a more accurate solution. For example:
1. Is the macro supposed to overwrite existing data?
2. Will there always be one header column and one data column, or will they vary?
0
 
LVL 5

Author Comment

by:magento
ID: 39767837
Hi Macroshadow,

Thanks for this.

I will open a new question with the answer to the above post .

Thanks again
0
 
LVL 5

Author Comment

by:magento
ID: 39776788
0

Featured Post

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
How to get Spreadsheet Compare 2016 working with the 64 bit version of Office 2016
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question