#1   Report Post  
TUNGANA KURMA RAJU
 
Posts: n/a
Default customised output

col a col b col c
john 2 john
mary 3 john
cathy 0 mary
jones 4 mary
mary
jones
jones
jones
jones
col a and col b is my input.Is there any formula to get out put like col c.I
fave a big list of col a and col b.Please give me idea.

  #2   Report Post  
Dave Peterson
 
Posts: n/a
Default customised output

I know that I wouldn't/couldn't do it using a formula, but a small macro could
do it.

If you want a macro:

Option Explicit
Sub testme()

Dim FirstRow As Long
Dim LastRow As Long
Dim iRow As Long
Dim oRow As Long
Dim wks As Worksheet
Dim TimesToRepeat As Long

Set wks = ActiveSheet

With wks
FirstRow = 1
LastRow = .Cells(.Rows.Count, "B").End(xlUp).Row

oRow = 1
For iRow = FirstRow To LastRow
TimesToRepeat = .Cells(iRow, "B").Value
If TimesToRepeat 0 Then
.Cells(oRow, "C").Resize(TimesToRepeat).Value _
= .Cells(iRow, "A").Value
oRow = oRow + TimesToRepeat
End If
Next iRow
End With
End Sub

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

Be aware that there is not a speck of validation in this routine. If you put
non-numeric values in column B, it'll blow up real good.

TUNGANA KURMA RAJU wrote:

col a col b col c
john 2 john
mary 3 john
cathy 0 mary
jones 4 mary
mary
jones
jones
jones
jones
col a and col b is my input.Is there any formula to get out put like col c.I
fave a big list of col a and col b.Please give me idea.


--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
output date modified if data is entered for multiple rows [email protected] Excel Discussion (Misc queries) 4 October 13th 05 08:09 PM
mixed font styles in the output of a formula? trumbore Excel Worksheet Functions 1 September 14th 05 02:45 AM
Mutiple Regression output happycow Excel Discussion (Misc queries) 2 July 29th 05 06:46 PM
automatic output from known data lsu-i-like Excel Discussion (Misc queries) 2 June 17th 05 08:22 PM
Creating customised calendars Dee Excel Discussion (Misc queries) 0 February 14th 05 04:07 PM


All times are GMT +1. The time now is 10:20 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"