• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 385
  • Last Modified:

Excel macro needed

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
magento
Asked:
magento
  • 4
  • 4
2 Solutions
 
Shaun KlineLead Software EngineerCommented:
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
 
magentoAuthor Commented:
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
 
aikimarkCommented:
is the phone number data the only data that will possibly be missing?
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
magentoAuthor Commented:
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
 
aikimarkCommented:
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
 
magentoAuthor Commented:
Thanks for ur reply.

But this takes me time to do for many times and hence i prefer only macro .
0
 
aikimarkCommented:
a macro can do this, but you haven't supplied enough detail for a macro that would likely solve your problem completely.
0
 
magentoAuthor Commented:
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
 
aikimarkCommented:
@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

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

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