Solved

Excel macro needed

Posted on 2014-01-13
9
366 Views
Last Modified: 2014-01-28
Hi ,

I need a help in writing a macro to do my daily jobs.

Please find the input and desired output.

The column names in sheet1 is transposed in column 2 .

So the data value in sheet 1 need to match the corresponding columns in sheet 2.

Thank you .
sample.xlsx
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
  • 4
9 Comments
 
LVL 26

Assisted Solution

by:Shaun Kline
Shaun Kline earned 250 total points
ID: 39776800
If your desire is to simply transpose a row to columns (or vice versa), have you tried just recording a macro while performing this task? It will give you a base to start for modifications, if needed.
0
 
LVL 5

Author Comment

by:magento
ID: 39777099
Yes, i tried the idea .

But the problem is that some time one of the fields is missing. For example sometimes there will be no phone number. And hence the recorded macro not providing exact result.

So i was asked for macro  which should be able to recognize the field title and paste information if available.
0
 
LVL 45

Expert Comment

by:aikimark
ID: 39781278
is the phone number data the only data that will possibly be missing?
0
Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

 
LVL 5

Author Comment

by:magento
ID: 39784561
Hi,

Most of the time , the phone number only missing.

Is it possible for write macro for any missing columns and accomodate that ?

Thanks
0
 
LVL 45

Accepted Solution

by:
aikimark earned 250 total points
ID: 39785618
The simplest approach would be first to insert a phone number row in the sections where it is missing and then to do the cell copy with transpose.

If there are more (than phone numbers) possible missing data, then you will need to specify all the possible missing data names.
0
 
LVL 5

Author Comment

by:magento
ID: 39787644
Thanks for ur reply.

But this takes me time to do for many times and hence i prefer only macro .
0
 
LVL 45

Expert Comment

by:aikimark
ID: 39788651
a macro can do this, but you haven't supplied enough detail for a macro that would likely solve your problem completely.
0
 
LVL 5

Author Comment

by:magento
ID: 39788762
Hi,

As per the attached sample file in my original post, i need a macro which run thru sheet 1 and paste the values in sheet2 based on the variable names in sheet1(columnA)

Thanks
0
 
LVL 45

Expert Comment

by:aikimark
ID: 39789245
@magento

Per your prior comment, if the phone number is not the only possible missing row data, then what are the mappings?  It looks like the row header might be stripped of its trailing colon character (:) and possibly be matched with the column headers, but that is an assumption on my part.  This kind of detailed problem statement is what the experts need.
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Suggested Solutions

This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

696 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