PC Review


Reply
Thread Tools Rate Thread

different sheets (ledgers)

 
 
shaqil
Guest
Posts: n/a
 
      21st Jul 2007
Deal All,

I have the following data in a file

JV # JV Dt Party Amount
1 21-07-07 abc 10
2 22-07-07 def 20
3 23-07-07 xyz 30
4 24-07-07 def 40
5 25-07-07 xyz 50

I need to create a macro that should prepare individual sheets for all
parties e.g "xyz" and has the following data

JV # JV Dt Party Amount Running Balance
3 23-07-07 xyz 30 30
5 25-07-07 xyz 50 80

Anybody can help me,

Thnx in advance.

 
Reply With Quote
 
 
 
 
Bob Phillips
Guest
Posts: n/a
 
      21st Jul 2007
Public Sub ProcessData()
Const TEST_COLUMN As String = "A" '<=== change to suit
Dim i As Long
Dim iLastRow As Long
Dim cell As Range
Dim sh As Worksheet

With ActiveSheet

iLastRow = .Cells(.Rows.Count, TEST_COLUMN).End(xlUp).Row
For i = 2 To iLastRow
Set sh = Nothing
On Error Resume Next
Set sh = Worksheets(.Cells(i, "C").Value)
On Error GoTo 0
If sh Is Nothing Then
Worksheets.Add.Name = .Cells(i, "C").Value
Set sh = ActiveSheet
.Rows(1).Copy sh.Rows(1)
Else
If Application.CountIf(.Range("C1").Resize(i), .Cells(i,
"C").Value) = 1 Then
sh.Cells.ClearContents
.Rows(1).Copy sh.Rows(1)
End If
End If
.Cells(i, "A").Resize(, 4).Copy _
sh.Cells(sh.Rows.Count, "A").End(xlUp).Offset(1, 0)
Next i

End With

End Sub


--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"shaqil" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Deal All,
>
> I have the following data in a file
>
> JV # JV Dt Party Amount
> 1 21-07-07 abc 10
> 2 22-07-07 def 20
> 3 23-07-07 xyz 30
> 4 24-07-07 def 40
> 5 25-07-07 xyz 50
>
> I need to create a macro that should prepare individual sheets for all
> parties e.g "xyz" and has the following data
>
> JV # JV Dt Party Amount Running Balance
> 3 23-07-07 xyz 30 30
> 5 25-07-07 xyz 50 80
>
> Anybody can help me,
>
> Thnx in advance.
>



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Tracking many ledgers in Excel? geigersc Microsoft Excel Misc 6 25th Feb 2008 02:19 AM
Print sheets by "All Sheets in workbook, EXCEPT for specific named sheets". Possible? Corey Microsoft Excel Programming 2 11th Dec 2006 01:35 AM
Macro for filter on protected workbook that works for all sheets, no matter what sheets are named? StargateFanFromWork Microsoft Excel Programming 6 26th Jan 2006 06:31 PM
accounting ledgers and journals =?Utf-8?B?bGx2OHJncmw=?= Microsoft Excel Misc 0 7th Jan 2005 06:07 AM
employee ledgers =?Utf-8?B?UmljayBUaGUgU3Rvcm1ha2Vy?= Microsoft Excel Setup 0 1st Nov 2004 05:34 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:04 PM.