[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 400
  • Last Modified:

Excel Macro

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
magento
Asked:
magento
  • 4
  • 3
1 Solution
 
MacroShadowCommented:
Nothing attached.
0
 
magentoAuthor Commented:
I am sorry .

Please find the attached.
sample-2.xlsx
0
 
MacroShadowCommented:
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
 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

 
Alexander Eßer [Alex140181]Software DeveloperCommented:
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
 
magentoAuthor Commented:
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
 
MacroShadowCommented:
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
 
magentoAuthor Commented:
Hi Macroshadow,

Thanks for this.

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

Thanks again
0
 
magentoAuthor Commented:
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now