Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default different sheets (ledgers)

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.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default different sheets (ledgers)

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" wrote in message
ups.com...
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
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
Tracking many ledgers in Excel? geigersc Excel Discussion (Misc queries) 6 February 25th 08 02:19 AM
Print sheets by "All Sheets in workbook, EXCEPT for specific named sheets". Possible? Corey Excel Programming 2 December 11th 06 01:35 AM
How to repeat a code for selected sheets (or a contiguous range of sheets) in a Workbook? Dmitry Excel Worksheet Functions 6 March 29th 06 12:43 PM
Macro for filter on protected workbook that works for all sheets, no matter what sheets are named? StargateFanFromWork[_3_] Excel Programming 6 January 26th 06 06:31 PM
accounting ledgers and journals llv8rgrl Excel Discussion (Misc queries) 0 January 7th 05 06:07 AM


All times are GMT +1. The time now is 03:57 AM.

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

About Us

"It's about Microsoft Excel"