Solved

Excel macro needed

Posted on 2014-01-13
9
371 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
Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

 
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

Revamp Your Training Process

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

Question has a verified solution.

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

You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

691 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