Hi Ashish,
Thanks a lot for the code, it worked well. It saved lot of my time.

One question, do you know how to add a condition that if the % is given as 
zero, then we can ignore that particular cell.

I have given an example in my initial question.

The reason I am requesting for including this condition is that there are 
many cells which has value of zero in my actual workbook. If excluding the 
zeros, the number of rows created would come down by 50%.

Thanks
Umesh

On Sunday, 2 February 2014 23:07:19 UTC+5:30, ashish wrote:
>
> Sub test()
>
> Sheets("Output").UsedRange.Clear
>
> Dim i As Long
> Dim j As Long
> Dim k As Long
> Dim s As Long
> k = 2
> Sheets("Input").Select
> For i = 2 To Range("a4").Row
>     For j = Range("e5").Column To Range("g5").Column
>         For s = Range("i5").Column To Range("k5").Column
>             Range("a" & i & ":c" & i).Copy 
> Destination:=Sheets("Output").Range("a" & k)
>             Sheets("Output").Range("d" & k) = Cells(1, j)
>             Sheets("Output").Range("f" & k) = Cells(i, j).Text
>             Sheets("Output").Range("e" & k) = Cells(1, s)
>             Sheets("Output").Range("g" & k) = Cells(i, s).Text
>             k = k + 1
>         Next
>     Next
>     
> Next
>
>
>
>
>
> End Sub
>
>
>
> On Tue, Jan 28, 2014 at 2:20 PM, Umesh Kumar <umes...@gmail.com<javascript:>
> > wrote:
>
>> Hi,
>> My apologies, i uploaded the wrong work book second time around. Attached 
>> is the actual book.* (File Name: Request.xlsx)*
>>
>>
>> On Tuesday, 28 January 2014 00:26:27 UTC+5:30, bé trần văn wrote:
>>
>>> You see File, with PivotTable VBA.
>>>
>>> 2014-01-27 Umesh Kumar <umes...@gmail.com>
>>>
>>>  Hi Ashish, 
>>>> I had pasted the sample file. Will attache it again.
>>>>
>>>> On Saturday, 25 January 2014 12:52:29 UTC+5:30, ashish wrote: 
>>>>>
>>>>> please share sample file
>>>>>
>>>>>
>>>>> On Fri, Jan 24, 2014 at 2:13 PM, Umesh Kumar <umes...@gmail.com>wrote:
>>>>>
>>>>>>  I would need help in converting table which is in table format to a 
>>>>>> pivot format. Below is the sample data which i have:
>>>>>>
>>>>>>
>>>>>> <https://lh4.googleusercontent.com/-vbalsIIFZZk/UuInVDUhywI/AAAAAAAABsE/Vkk8VwAXgDM/s1600/Untitled.png>
>>>>>> <https://lh4.googleusercontent.com/-vbalsIIFZZk/UuInVDUhywI/AAAAAAAABsE/Vkk8VwAXgDM/s1600/Untitled.png>
>>>>>>  
>>>>>>
>>>>>>  
>>>>>>
>>>>>>
>>>>>>
>>>>>> I need in the output in the below format:
>>>>>>
>>>>>>
>>>>>> <https://lh5.googleusercontent.com/-WRLkj-rLs88/UuInes-s1CI/AAAAAAAABsM/2rp-j97-Ywo/s1600/Untitled2.png>
>>>>>>
>>>>>>  
>>>>>>
>>>>>>
>>>>>>  
>>>>>>
>>>>>>  
>>>>>>
>>>>>>    
>>>>>>
>>>>>>
>>>>>>
>>>>>> If you see for each row of Product 1, i need three rows of country 
>>>>>> and for three rows of customer type. The only exception is if either of 
>>>>>> country of customer type is 0% we can ignore those cells. So for example 
>>>>>> from the above output table we may not need the Japan rows because Japan 
>>>>>> is 
>>>>>> given as 0% for Product 1
>>>>>>  
>>>>>>  
>>>>>>
>>>>>> Similarly for Product 2, we may not need "Individual" rows because it 
>>>>>> is given as zero. I do not know how to write vb codes, so tried 
>>>>>> recording 
>>>>>> macro, however because of huge volume of data, the macro does not work.
>>>>>>
>>>>>>
>>>>>> Regards
>>>>>>
>>>>>> -- 
>>>>>> Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? 
>>>>>> It’s =TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ 
>>>>>> https://www.facebook.com/discussexcel
>>>>>>  
>>>>>> FORUM RULES
>>>>>>  
>>>>>> 1) Use concise, accurate thread titles. Poor thread titles, like 
>>>>>> Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need 
>>>>>> Advice will not get quick attention or may not be answered.
>>>>>> 2) Don't post a question in the thread of another member.
>>>>>> 3) Don't post questions regarding breaking or bypassing any security 
>>>>>> measure.
>>>>>> 4) Acknowledge the responses you receive, good or bad.
>>>>>> 5) Jobs posting is not allowed.
>>>>>> 6) Sharing copyrighted material and their links is not allowed.
>>>>>>  
>>>>>> NOTE : Don't ever post confidential data in a workbook. Forum owners 
>>>>>> and members are not responsible for any loss.
>>>>>> --- 
>>>>>> You received this message because you are subscribed to the Google 
>>>>>> Groups "MS EXCEL AND VBA MACROS" group.
>>>>>> To unsubscribe from this group and stop receiving emails from it, 
>>>>>> send an email to excel-macros...@googlegroups.com.
>>>>>> To post to this group, send email to excel-...@googlegroups.com.
>>>>>> Visit this group at http://groups.google.com/group/excel-macros.
>>>>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> -- 
>>>>>  *Regards*
>>>>>  
>>>>> *Ashish Koul*
>>>>>
>>>>>
>>>>>  *Visit*
>>>>> http://www.excelvbamacros.in
>>>>> Like Us on 
>>>>> Facebook<http://www.facebook.com/pages/Excel-VBA-Codes-Macros/151803898222297>
>>>>> Join Us on Facebook <http://www.facebook.com/groups/163491717053198/>
>>>>>
>>>>>
>>>>> P Before printing, think about the environment.
>>>>>  
>>>>>  
>>>>>
>>>> -- 
>>>> Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? 
>>>> It’s =TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ 
>>>> https://www.facebook.com/discussexcel
>>>>  
>>>> FORUM RULES
>>>>  
>>>> 1) Use concise, accurate thread titles. Poor thread titles, like Please 
>>>> Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice 
>>>> will not get quick attention or may not be answered.
>>>> 2) Don't post a question in the thread of another member.
>>>> 3) Don't post questions regarding breaking or bypassing any security 
>>>> measure.
>>>> 4) Acknowledge the responses you receive, good or bad.
>>>> 5) Jobs posting is not allowed.
>>>> 6) Sharing copyrighted material and their links is not allowed.
>>>>  
>>>> NOTE : Don't ever post confidential data in a workbook. Forum owners 
>>>> and members are not responsible for any loss.
>>>> --- 
>>>> You received this message because you are subscribed to the Google 
>>>> Groups "MS EXCEL AND VBA MACROS" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send 
>>>> an email to excel-macros...@googlegroups.com.
>>>> To post to this group, send email to excel-...@googlegroups.com.
>>>> Visit this group at http://groups.google.com/group/excel-macros.
>>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>>
>>>
>>>  -- 
>> Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s 
>> =TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ 
>> https://www.facebook.com/discussexcel
>>  
>> FORUM RULES
>>  
>> 1) Use concise, accurate thread titles. Poor thread titles, like Please 
>> Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice 
>> will not get quick attention or may not be answered.
>> 2) Don't post a question in the thread of another member.
>> 3) Don't post questions regarding breaking or bypassing any security 
>> measure.
>> 4) Acknowledge the responses you receive, good or bad.
>> 5) Jobs posting is not allowed.
>> 6) Sharing copyrighted material and their links is not allowed.
>>  
>> NOTE : Don't ever post confidential data in a workbook. Forum owners and 
>> members are not responsible for any loss.
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "MS EXCEL AND VBA MACROS" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to excel-macros...@googlegroups.com <javascript:>.
>> To post to this group, send email to excel-...@googlegroups.com<javascript:>
>> .
>> Visit this group at http://groups.google.com/group/excel-macros.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>
>
> -- 
> *Regards*
>  
> *Ashish Koul*
>
>
> *Visit*
> http://www.excelvbamacros.in
> Like Us on 
> Facebook<http://www.facebook.com/pages/Excel-VBA-Codes-Macros/151803898222297>
> Join Us on Facebook <http://www.facebook.com/groups/163491717053198/>
>
>
> P Before printing, think about the environment.
>
>  
>  

-- 
Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s 
=TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ 
https://www.facebook.com/discussexcel

FORUM RULES

1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
quick attention or may not be answered.
2) Don't post a question in the thread of another member.
3) Don't post questions regarding breaking or bypassing any security measure.
4) Acknowledge the responses you receive, good or bad.
5) Jobs posting is not allowed.
6) Sharing copyrighted material and their links is not allowed.

NOTE  : Don't ever post confidential data in a workbook. Forum owners and 
members are not responsible for any loss.
--- 
You received this message because you are subscribed to the Google Groups "MS 
EXCEL AND VBA MACROS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to excel-macros+unsubscr...@googlegroups.com.
To post to this group, send email to excel-macros@googlegroups.com.
Visit this group at http://groups.google.com/group/excel-macros.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to